Question: In C Programming Using C, write a simulated dice game of PIG. PIG requires two six-sided dice. The goal of the game is to be

 In C Programming Using C, write a simulated dice game of

In C Programming

Using C, write a simulated dice game of PIG. PIG requires two six-sided dice. The goal of the game is to be the first player to reach 100 points. On a turn, a player rolls the die repeatedly until either: A1 is rolled If a 1 is rolled on a single die, that player's turn ends and no points are earned for the turn. o However, if "snake eyes" (or double 1's) are rolled, it earns 25 points. All other doubles earn twice the value on the dice. The player chooses to hold (stop rolling). o If the player chooses to hold, all the points rolled during that turn are added to his/her score. Scoring Examples: Sherri rolls a 3 and a 4 then decides to continue. She then chooses to continue rolling 6 & 6, 6 & 4,5 & 6,1 & 2. Because she rolled a 1, Sherri's turn ends and she earns 0 points. Craig rolls a 6 & 2 and decides to continue. He then chooses to continue rolling 3 & 4,5 & 5 and then decides to hold. Craig earns 35 points for this turn: 6+2+3+4+2* (5+5)=35. Sample Output: Playerl score: 0 Player2 score: 0 Playerl rolls 4 and 2. Your total for this turn is 6. Do you want to roll again (Y/N)? y Playerl rolls 2 and 5. Your total for this turn is 13. Do you want to roll again (Y/N)? y Playerl rolls 1 and 1. Your total for this turn is 38. Do you want to roll again (Y/N)? n Player2 rolls 3 and 4. Your total for this turn is 7. Do you want to roll again (Y/N)? y Player2 rolls 4 and 3. Your total for this turn is 14. Do you want to roll again (Y/N)? Y Player2 rolls 3 and 4. Your total for this turn is 21. Do you want to roll again (Y/N)? Y Player2 rolls 3 and 1. Your total for this turn is 0. Playerl score: 38 Player2 score: 0 Player1 rolls 1 and 1. Your total for this turn is 25. Do you want to roll again (Y/N)? Y Playerl rolls 2 and 6. Your total for this turn is 33. Do you want to roll again (Y/N)? n Player2 rolls 6 and 5. Your total for this turn is 11. Do you want to roll again (Y/N)? Y Player2 rolls 3 and 5. Your total for this turn is 19. Do you want to roll again (Y/N)? y Player2 rolls 5 and 6. Your total for this turn is 30. Do you want to roll again (Y/N)? n Playerl score: 71 Player2 score: 30 Using C, write a simulated dice game of PIG. PIG requires two six-sided dice. The goal of the game is to be the first player to reach 100 points. On a turn, a player rolls the die repeatedly until either: A1 is rolled If a 1 is rolled on a single die, that player's turn ends and no points are earned for the turn. o However, if "snake eyes" (or double 1's) are rolled, it earns 25 points. All other doubles earn twice the value on the dice. The player chooses to hold (stop rolling). o If the player chooses to hold, all the points rolled during that turn are added to his/her score. Scoring Examples: Sherri rolls a 3 and a 4 then decides to continue. She then chooses to continue rolling 6 & 6, 6 & 4,5 & 6,1 & 2. Because she rolled a 1, Sherri's turn ends and she earns 0 points. Craig rolls a 6 & 2 and decides to continue. He then chooses to continue rolling 3 & 4,5 & 5 and then decides to hold. Craig earns 35 points for this turn: 6+2+3+4+2* (5+5)=35. Sample Output: Playerl score: 0 Player2 score: 0 Playerl rolls 4 and 2. Your total for this turn is 6. Do you want to roll again (Y/N)? y Playerl rolls 2 and 5. Your total for this turn is 13. Do you want to roll again (Y/N)? y Playerl rolls 1 and 1. Your total for this turn is 38. Do you want to roll again (Y/N)? n Player2 rolls 3 and 4. Your total for this turn is 7. Do you want to roll again (Y/N)? y Player2 rolls 4 and 3. Your total for this turn is 14. Do you want to roll again (Y/N)? Y Player2 rolls 3 and 4. Your total for this turn is 21. Do you want to roll again (Y/N)? Y Player2 rolls 3 and 1. Your total for this turn is 0. Playerl score: 38 Player2 score: 0 Player1 rolls 1 and 1. Your total for this turn is 25. Do you want to roll again (Y/N)? Y Playerl rolls 2 and 6. Your total for this turn is 33. Do you want to roll again (Y/N)? n Player2 rolls 6 and 5. Your total for this turn is 11. Do you want to roll again (Y/N)? Y Player2 rolls 3 and 5. Your total for this turn is 19. Do you want to roll again (Y/N)? y Player2 rolls 5 and 6. Your total for this turn is 30. Do you want to roll again (Y/N)? n Playerl score: 71 Player2 score: 30

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!