Question
Program 1 Rock, Paper, Scissors This program is to refresh memories and abilities to program in C. Even though this class focuses on C++ as
Program 1 Rock, Paper, Scissors This program is to refresh memories and abilities to program in C. Even though this class focuses on C++ as a programming language, C is an integral part of C++. In this program, the student will program Rock, Paper, Scissors in C. The game has the following rules: 1. The player chooses between Rock, Paper, and Scissors to play against the computer. 2. The Computer randomly picks Rock, Paper, or Scissors to play against the player. 3. Rock crushes Scissors 4. Scissors cuts Paper 5. Paper covers Rock 6. If the player and computer play the exact same thing, it is considered a tie. The student programmer will be provided with the following snippet of code: The student programmers job is to write the functions int play_game(int *) and int menu(int *). The student programmer will also update the Comment Header at the top of pgm1.c. DO NOT: 1) Modify the main function 2) Add global variables. int menu(int *): Receives: integer array score Returns: Menu number for Rock, Paper, Scissors, or Exit. Returns -1 for any other number than applicable menu choice Grading: 1) Displays ROCK PAPER SCISSORS! at the top of the menu 2) Displays the current score between the player and the computer (including ties) 3) Displays choice numbers for Rock, Paper, Scissors, and Exit. 4) Asks for a choice If improper choice is given (alpha-numeric and wrong number), asks for another choice 5) Console Display is organized and easily read 6) Code is organized and easily read (Comments where needed) HINT: Use of a switch statement makes the code a little easier to read. int play_game(int *): Receives: integer array score Returns: an index of score to be incremented. If the player wins, returns 0. If the computer wins, returns 1. If there is a tie, returns 2. Grading: 1) The computer choice is randomly generated between 3 numbers using rand(). 2) Displays BOTH the User choice and the Computer Choice 3) Displays whether the result is a win, loss, or tie for the User. 4) Displays the following statements depending on what was played by the User and Computer ROCK CRUSHES SCISSORS! SCISSORS CUT PAPER! PAPER COVERS ROCK! TIE BAZINGA! 5) Returns 0 if the User won, 1 if the Computer won, and 2 if the User and Computer Tied. DELIVERABLES: 1) pgm1.c 2) makefile (no extension) NOTE: This program must compile using MinGW compiler used in the class. Points will be deducted if the program does not compile using MinGW. BONUS (+ 10 Pts): Incorporate the options Lizard and Spock from the game Rock Paper Scissors Lizard Spock made popular from CBS sitcom The Big Bang Theory. The outcomes are as follows: Scissors cuts Paper Paper covers Rock Rock crushes Lizard Lizard poisons Spock Spock smashes Scissors Scissors decapitates Lizard Lizard eats Paper Paper disproves Spock Spock vaporizes Rock Rock crushes Scissors
Step 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