Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 10 Weeks Ago, 4 Days Ago |
Questions Answered: | 4870 |
Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Write Python Code for a dice game. 2 players and a die are required.
Â
Rules:
     1) Roll the Dice.
     2) If user rolled a 1:
             The pot gets set to zero
             The other player goes to step 1.
     3) Else roll of 2-6 is added to the pot.
     4) User can choose to hold or roll again.
              Choice ROLL= Return to Step 1.
              Choice HOLD=
                    -Increment Player score by the pot amount.
                    -Pot gets set to 0.
                    -second player gets to roll and goes to Step 1.
Â
Â
ADDITIONAL INFO!
- Before each opponent begins rolling: Â Â Â Â Â Â Â Â Output the score for the person and the computer.
- Output the opponents whose turn is beginning and ask the user to hit enter to    continue.
- With each dice roll.     Output the die value, and amount of the round pot. - If it�s the users roll ask if they want to roll again ( R ) or Hold ( H ). Your program    should allow r, R, h or H as valid input. If input is anything else, ask the user    again until valid input is obtained.
- The AI will continue playing until the round pot is 20 or more. - Once a players pot is greater or equal to 50 then they have won, it will no longer ask if    they want to keep rolling the die or not.
- Once there is a winner        Score totals are output along with who the winner was. User or Computer
- Player is asked if they want to play again Y or N. Valid input should be y, Y, yes, Â Â Â Â YES, or n, N, no, NO.
Â
-When a new game starts the starting roll goes to the player that did not roll last. If the
User rolled last in the previous game, then the computer rolls first and vice versa. When
the program first begins, the player will make the first roll of the first game