Question: Ive been stuck on this code for a while now so i come to the experts. i am constructing a pig dice game with 2

Ive been stuck on this code for a while now so i come to the experts. i am constructing a pig dice game with 2 human players and every time i try i end up in an infinite loop when the player rolls a 1. I am programming in C++ and here here are the requirements

Construct the game of PIG. Here are the rules:

There are two local players Player 1 will go first It would be very advantageous to use the rand() % 6 + 1 as your dice formula.

Single Die Rules

The player will roll the die repeatedly accumulating points shown on the dies value. The player will continue to roll until satisfied with their score. If the player rolls a 1, they will lose all points earned during that round and their turn ends. The process will repeat until a player is the first to reach 100 points or greater.

Two Dice Rules

The player will roll the dice repeatedly accumulating points shown on the dies value. The player will continue to roll until satisfied with their score. If the player rolls a 1 on either die, they will lose all points earned during that round and their turn ends. If the player rolls snake eyes (double 1s) they will lose all points earned and start back at 0. The process will repeat until a player is the first to reach 100 points or greater.

Our game should contain the following:

2 Player mode - Human controlled player 1 and2 GamemodeA&B-Aissingledie,Bistwodice Use validation if necessary,

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!