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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!