Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me with this problem in C. Project Description: In this Project, you will write a C program to create a simple version of

Please help me with this problem in C.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Project Description: In this Project, you will write a C program to create a simple version of the Game of the Goose using 24 spaces and a two-player genle mode. Player I will be the human player player 2 will be the computer. When running the program, the user will be asked to enter an integer nurnber, which will be used as a seed for the generation of randorn nurnbers when rulling the clice. Then, your prgran prints a welccrne menu displaying two options: 1) Press 'P' or y' to play or 2) Press '' urly lo quil. If the selected option is to play the game, the players should roll the dice (press cuter) to determine which player should go first. The player who gets the highest value will go first in the game. Here is an example: HUMAN DEVER, centar Al! the dich 6 .nd 2 For a 6 COMPITER DAYRR, TT293 CALA 1:11 he dice and cor as HUM E R e rir If there is a tie determining who goes first (i.c. both the Human and Computer roll the same value), a message is printed staring 50, and the process is repeated until two different values are rolled. The highest roll then goes first. After determinini wbicbpliver goes first 24 species are displayed in two lines, each represented by a number enclosed in suare brackets (12 punibers in teach line and separated by tabs. The only exception is the last spice which doesn't use bricket but insteal is clisplayed is 24>. A character he le murder indicale inal it is a special p e. A gray is represenle by +, the bridge by 13. maza by all the skull by '!. The following table inclicles The special spaces: Symbol Spaces Action goose 7,11,15 move your picce again by the same distance bridaco 20 to space 12 maze 13.20 go back to your previous space skull 23 return to the beginning The characters 'S iod 'S' are used to represent the pieces of human and computer player, respectively. When it player lands on a space, the spice number is NOT displayed but only the player instead. If both players are in the side space, human's character is always shewn first. Playing the game: After selecting play in the main menu the goose board is displayed with both players' pieces in the start position. Below the board, a message is displayed indicating which player will next roll the dice (assuming a player didn't win the previous roll). This information should be shown in a manner similar to: [HUMAN/COMPUTER] PLAYER'S TURN, [current space]... Press to roll the dice After the player presses (the human player should also roll for the computer) the value of each die along with the sum of both dice is shown. The next line shows a summary of the main movements performed in that roll. If more than one movement is carried out, a comma separates each movement. The main possible movements are: o go to space # o come back to space # o return to start After the main movements are performed, the new board status is shown If the new board status shows that the player won during the roll, a message is displayed indicating that the game is over, and stating which player (Human or Computer) wins: "-GAME OVER-" Player # won ! Then the following message is displayed, allowing the user to return to the main menu: Press to return to the main menu Example Output: This is an example of some of the output that might be displayed on the screen based on the inputs and result of the dice sum: Enter a seed for the random number generator: 10 Welcome to the game of goose, please select an option: Press 'P' or 'p' to play Press 'O' or 'q' to quit HUMAN PLAYER, Press to roll the dice 6 and 2 for a 8 COMPUTER PLAYER, Press to roll the dice 3 and 2 for a 5 HUMAN PLAYER goes first [$] [2] [3] [4] [5] * [6] + [7] [8] [9] [10] +[11] [12] -(13] (14) +[15] [16] [17] [18] [19] - [20] [21] [22] ! [23] HUMAN PLAYER'S TURN, [1]... Press to roll the dice 6 and 3 for a 9 go to space 10 [%] [2] [3] [4] [5] [6] +[7] [8] [9] [$]+[11] [12] -(13) (14) +[15] [16] [17] [18] [19] - [20] [21] [22] ! (23) COMPUTER PLAYER'S TURN, [1]... Press to roll the dice 4 and 6 for a 10 go to space 11, go to space 21 [1] [2] [3] [4] [5] [6] + [7] [8] [9] [$] +[11] [12] - [13] (14) +[15] [16] [17] [18] [19] - [20] [8] [22] : [23] HUMAN PLAYER'S TURN, [10]... Press to roll the dice [1] [2] [3] [4] [5] *[6] + [7] [8] [9] [$]+[11] [12] -[13] [14] +[15] [16] [17] [18] [19] - [20] [%] [22] ! [23] HUMAN PLAYER'S TURN, [10]... Press to roll the dice 3 and 2 for 5 go to space 15, go to space 20, come back to space 10 [1] [2] [3] [4] [5] *[6] + [7] [8] [9] [$] +[11] [12] -[13] [14] +[15] [16] [17] [18] [19] - [20] [8] [22] ![23] COMPUTER PLAYER'S TURN, [21]... Press to roll the dice 1 and 2 for a 3 go to space 24 [1] [2] [3] [4] [5] [6] + [7] [8] [9] [$] +[11] [12] -[13] [14] +[15] [16] [17] [18] [19] - [20] [21] [22] ! [23] > Game over! Computer Won! Press to return to the main menu Project Description: In this Project, you will write a C program to create a simple version of the Game of the Goose using 24 spaces and a two-player genle mode. Player I will be the human player player 2 will be the computer. When running the program, the user will be asked to enter an integer nurnber, which will be used as a seed for the generation of randorn nurnbers when rulling the clice. Then, your prgran prints a welccrne menu displaying two options: 1) Press 'P' or y' to play or 2) Press '' urly lo quil. If the selected option is to play the game, the players should roll the dice (press cuter) to determine which player should go first. The player who gets the highest value will go first in the game. Here is an example: HUMAN DEVER, centar Al! the dich 6 .nd 2 For a 6 COMPITER DAYRR, TT293 CALA 1:11 he dice and cor as HUM E R e rir If there is a tie determining who goes first (i.c. both the Human and Computer roll the same value), a message is printed staring 50, and the process is repeated until two different values are rolled. The highest roll then goes first. After determinini wbicbpliver goes first 24 species are displayed in two lines, each represented by a number enclosed in suare brackets (12 punibers in teach line and separated by tabs. The only exception is the last spice which doesn't use bricket but insteal is clisplayed is 24>. A character he le murder indicale inal it is a special p e. A gray is represenle by +, the bridge by 13. maza by all the skull by '!. The following table inclicles The special spaces: Symbol Spaces Action goose 7,11,15 move your picce again by the same distance bridaco 20 to space 12 maze 13.20 go back to your previous space skull 23 return to the beginning The characters 'S iod 'S' are used to represent the pieces of human and computer player, respectively. When it player lands on a space, the spice number is NOT displayed but only the player instead. If both players are in the side space, human's character is always shewn first. Playing the game: After selecting play in the main menu the goose board is displayed with both players' pieces in the start position. Below the board, a message is displayed indicating which player will next roll the dice (assuming a player didn't win the previous roll). This information should be shown in a manner similar to: [HUMAN/COMPUTER] PLAYER'S TURN, [current space]... Press to roll the dice After the player presses (the human player should also roll for the computer) the value of each die along with the sum of both dice is shown. The next line shows a summary of the main movements performed in that roll. If more than one movement is carried out, a comma separates each movement. The main possible movements are: o go to space # o come back to space # o return to start After the main movements are performed, the new board status is shown If the new board status shows that the player won during the roll, a message is displayed indicating that the game is over, and stating which player (Human or Computer) wins: "-GAME OVER-" Player # won ! Then the following message is displayed, allowing the user to return to the main menu: Press to return to the main menu Example Output: This is an example of some of the output that might be displayed on the screen based on the inputs and result of the dice sum: Enter a seed for the random number generator: 10 Welcome to the game of goose, please select an option: Press 'P' or 'p' to play Press 'O' or 'q' to quit HUMAN PLAYER, Press to roll the dice 6 and 2 for a 8 COMPUTER PLAYER, Press to roll the dice 3 and 2 for a 5 HUMAN PLAYER goes first [$] [2] [3] [4] [5] * [6] + [7] [8] [9] [10] +[11] [12] -(13] (14) +[15] [16] [17] [18] [19] - [20] [21] [22] ! [23] HUMAN PLAYER'S TURN, [1]... Press to roll the dice 6 and 3 for a 9 go to space 10 [%] [2] [3] [4] [5] [6] +[7] [8] [9] [$]+[11] [12] -(13) (14) +[15] [16] [17] [18] [19] - [20] [21] [22] ! (23) COMPUTER PLAYER'S TURN, [1]... Press to roll the dice 4 and 6 for a 10 go to space 11, go to space 21 [1] [2] [3] [4] [5] [6] + [7] [8] [9] [$] +[11] [12] - [13] (14) +[15] [16] [17] [18] [19] - [20] [8] [22] : [23] HUMAN PLAYER'S TURN, [10]... Press to roll the dice [1] [2] [3] [4] [5] *[6] + [7] [8] [9] [$]+[11] [12] -[13] [14] +[15] [16] [17] [18] [19] - [20] [%] [22] ! [23] HUMAN PLAYER'S TURN, [10]... Press to roll the dice 3 and 2 for 5 go to space 15, go to space 20, come back to space 10 [1] [2] [3] [4] [5] *[6] + [7] [8] [9] [$] +[11] [12] -[13] [14] +[15] [16] [17] [18] [19] - [20] [8] [22] ![23] COMPUTER PLAYER'S TURN, [21]... Press to roll the dice 1 and 2 for a 3 go to space 24 [1] [2] [3] [4] [5] [6] + [7] [8] [9] [$] +[11] [12] -[13] [14] +[15] [16] [17] [18] [19] - [20] [21] [22] ! [23] > Game over! Computer Won! Press to return to the main menu

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions