Question: python code( using functions please)! Rules of the game: - This game requires a dice. The goal of the game is to collect the correct
python code( using functions please)!
Rules of the game: - This game requires a dice. The goal of the game is to collect the correct number of coins to create a dollar. Players take coins based on a roll of the dice. The numbers on the dice correlate to the coin values as follows: 1penny 2nickel 3dime 4quarter 5 ( pick a random card from 1 to 4): o 1 = penny o 2 = nickel o 3 = dime o 4 = quarter 6lose a turn - Players take turns rolling the dice and adding coins. - The winner becomes the first player to reach exactly one dollar. - If taking a coin would put the player over a dollar, the player loses the turn.
requirements: 1- Need to have 2 players 2- Every turn the dice will be rolled randomly (value will vary between 1 6). 3- Depending on the dice value, you will update the total number of coins each player has. 4- Will keep rolling the dice and adding the coins, until one of the players wins. (Reach exactly $1). 5- By adding the coins each turn, if the total number of coins exceeds $1, then skip that turn and do not increase the coins total. Automatically it will be the other players turn. 6- Need to display the total coins for each player after each round. 7- After announcing the winner, ask players if they want to play again. (Yes/No). 8- Need to validate all user inputs.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
