Question
In C# programming: design and implement a program that allows the user to play a version of the dice game Pig against the computer. The
In C# programming:
design and implement a program that allows the user to play a version of the dice game Pig against the computer. The object of the game is to be the first to score 100 points. The user and the computer take turns rolling a pair of dice following these rules:
On a turn each player rolls 2 dice. If no 1 appears, the total of the dice is added to the player's score and the player can choose to roll again or pass the turn to the other player. When the computer does not roll a 1, decide if the computer wants to roll again by generating a random number between 1 and 2. 1 causes the computer to roll again. 2 causes the computer to pass.
If a 1 appears on one of the dice, nothing is added to the player's score and the player's turn is over.
If a 1 appears on both dice, the player's score is reset to 0 and the player's turn is over.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started