Complete Your Game

 

1.       If you have not already done so, add a loop to your game. 

The loop can be an infinite loop (while (1)).  The inside of the loop consists of the if statement that gives the user the choice of playing a game, showing a demo of the game and exiting.  When the user chooses to exit, the program ends.

 

2.       Change the menu above so that instead of the three choices, you have the following choices:

                play the math game (from lab 2)

play treasure game (from lab 4)

                play the random sleepwalker game (from lab 5)

                play the psychic game (from lab 6)

                play the guessing game (we did this in class together)

                play tic-tac-toe (we have not done this yet!)

                exit

 

The while loop will consist of the menu above and the if statement.

 However, this time, based upon the user choice, the main program will call a function that plays the game of choice.

 If the user chooses choice 1, the main program will call a function that plays the math game, etc. 

Each game will be in a function of its own! The function for the tic-tac-toe game will print out “sorry! game not ready”, because we will add this in at the end of the semester.