Question: 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

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 game mode. Player 1 will be the human player, player 2 will be the computer.

When running the program, the user will be asked to enter an integer number, which will be used as a seed for the generation of random numbers when rolling the dice. Then, your program prints a welcome menu displaying two options:

1) Press 'P' or 'p' to play or

2) Press 'Q' or 'q' to quit.

If the selected option is to play the game, the players should roll the dice (press enter) 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 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

If there is a tie determining who goes first (i.e. both the Human and Computer roll the same value), a message is printed stating so, and the process is repeated until two different values are rolled. The highest roll then goes first.

After determining which player goes first, 24 spaces are displayed in two lines, each represented by a number enclosed in square brackets (12 numbers in each line) and separated by tabs. The only exception is the last space which doesn't use bracket but instead is displayed as <24>. A character before a number indicate that it is a special space. A goose is represented by '+', the bridge by '*', a maze by '-' and the skull by '!'. The following table indicates the special spaces:

Symbol

Spaces

Action

goose

7, 11, 15

move your piece again by the same distance

bridge

6

go to space 12

maze

13, 20

go back to your previous space

skull

23

return to the beginning

The characters '$' and '%' are used to represent the pieces of human and computer player, respectively. When a player lands on a space, the space number is NOT displayed but only the player instead. If both players are in the same space, human's character is always shown 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 didnt win the previous roll). This information should be shown in a manner similar to:

[HUMAN/COMPUTER] PLAYERS 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:

    • go to space #

    • come back to space #
    • 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

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!