Question: C++: Can you help me with the comments on how you did this coded program so I can follow? Game Mechanics .There are two players:
C++: Can you help me with the comments on how you did this coded program so I can follow?
Game Mechanics .There are two players: the user and the computer, who alternate turns until one of them reaches 100 points or higher The user is always the first player and starts the game. If any player reaches 100 points or more at the end of their turn, the game ends immediately and the other player does not get another turn. . . .During one turn the player(either the user or computer) accumulates turnTotal over a series of dice rolls. o If they roll a 1 or 6, their turn ends and the turnTotal becomes 0. o If they roll a 3, their turn ends and turnTotal becomes 15 (irrespective what they collected up to that roll) o If they roll a 2,4,5, the value on the dice accumulates to turnTotal o The value on the dice is selected randomly during every roll. At the end of the turn, turnTotal is accumulated to playerTotal(either user or computer based on the turn). During a turn, before each roll, if the player is the user, they are given two options: o Continue rolling Hold; if the user chooses to Hold the user's turn ends and the turn is passed to the computer. o If the player is the computer, they will always continue rolling until their turn total reaches the value 10 or higher. If the turnTotal for the computer is 10 or higher, the computer's turn ends and the turn is passed to the user
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
