Question: Write a C++ program that allows 2 people to play a simple dice game. The game should alternate between players until one of them has

Write a C++ program that allows 2 people to play a simple dice game. The game should alternate between players until one of them has won. The rules are as follows:

Each turn, a player repeatedly rolls two dice:

- If no 1s are rolled, the sum of the dice is added to their turn total and the player's turn continues.

- If a player chooses to "hold", their turn total is added to their score, and it becomes the next player's turn.

- If a single 1 is rolled, the player scores nothing for that round and it becomes the next player's turn.

- If two 1s are rolled, the players entire score is lost, and it becomes the next player's turn.

The first player to score 100 or more points wins.

You should seed the random number generator using the time() function.

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!