Answered step by step
Verified Expert Solution
Question
1 Approved Answer
c++ Write a program to play the following game, which the user plays against the computer This game is played on an imaginary game board
c++
Write a program to play the following game, which the user plays against the computer This game is played on an imaginary game board that has numbered spaces arranged in a circle.Forexample, here is what a game board with 12 spaces might look like. 0 10 When the program starts, the user is asked to specify how many spaces there are on the game board. There must be at least five spaces The computer then randomly selects two spaces (excluding space numbers 0 and 1): One of the selected spaces is The Goal. The other is The Pit. The computer announces the two special spaces. Play then starts from space # : Each player, in tu rolls a pair of dice and moves to another space by advancing N spaces where N S the n m er tha came up on te dice Forex pie using the sample game board with 12 spaces, if the user rolled a 10 (6 plus 4) on her first turn and a 7 (3 + 4} on her second turn, then she would land on space #5. That's where she would start on her next turn . The user and the computer take turns rolling the dice and moving around the board. Each move is displayed on the screen (as text, not graphics; e.g., "You are now on space #3"). The game continues until one playe lands on The Goal (and wins the game) or on The Pit (and loses the game) The computer announces the outcome of each game and keeps track of each player's wins and losses The user can choose single play (user must pressStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started