Assignment
In this assignment, create the game called Rock Paper Scissors game with a little twist to it. In this version, you will also include Lizard and Spock. This means the players have the choice of Rock, Paper, Scissors, Lizard, and Spock.
The program will play the game between a user and the computer. The game will continue until there is a winner to the game, the user should not be prompted to see if they want to continue when there is a tie in the game. If the game is a tie then the program must make the user play again, until there is a winner. Once there is a winner, the program (game) must end.
The computers choice will be a random number generated by the program using the random number generator. The number must be limited to the following values:
• Rock
• Paper
• Scissors
• Lizard
• Spock
Use a menu to prompt the user for their choice, using the same values as above. The program will then display the computer's choice and the user's choice in a textual format. Meaning if the computer random number is 3 then it should display something like "The computer choice is Scissors".
The program will then determine if there is a winner or a tie. If there is a winner the program must tell the user, the rule the winner won by (listed below).
A winner is determined using the following rules:
1. Scissors cut paper
2. Paper covers rock
3. Rock crushes lizard
4. Lizard poisons Spock
5. Spock smashes (or melts) scissors
6. Scissors decapitate lizard
7. Lizard eats paper
8. Paper disproves Spock
9. Spock vaporizes rock
10. Rock breaks scissors
The program must be divided into functions with at least the following functions:
1. int getUserChoice()
a. Displays a menu of choices
b. Prompts the user for their choice from the menu
c. Return the users choice as an integer to main
2. int getComputerChoice()
a. Use the random number generator to create the computer's choice
b. returns the computer's choice as an integer to main
3. bool determineWinner(int userChoice, int compChoice)
a. Uses the two parameters to determine if there is a winner based on the rules provided above.
b. Return true if there is a winner, false otherwise (used to determine if tie so that the game can continue in main).
c. If a winner, then the correct message must be display indicating who won and by what rule.
4. void displayChoice(int choice)
a. To be used display user choice.
b. To be used to display computer choice.
c. Should be called two times o Display the choice as text not numeric (Such as "Rock" for choice of 1).
i. The program must indicate whose choice it is. Does not need to be done in the function
ii. Function just displays the choice, a single word.