Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use Matlab please Activities You are going to create an interactive Rock-Paper-Scissors game. Or, if you are feeling up to it... Rock-Paper-Scissors-Lizard-Spock. The rules are:
Use Matlab please
Activities You are going to create an interactive Rock-Paper-Scissors game. Or, if you are feeling up to it... Rock-Paper-Scissors-Lizard-Spock. The rules are: There are two players "simultaneously" choosing one of Rock, Paper, or Scissors; Rock beats Scissors; Paper beats Rock; Scissors beats Paper; When the same item is chosen by each player, then the result is a tie. Implement the game using a table lookup scheme (as discussed in class). Test all of the features you implement Test the code to ensure that the rules are followed in all cases. Ensure that the user cannot "break" the code/game. Implementation The code will need to do the following (within the setup, update, and reset scripts). 1. In the setup script, create a figure with the following controls arranged in an appropriate fashion paying attention to function AND aesthetic Display your name within the GUI; 3 buttons for the User/Human (one each for ROCK, PAPER, and SCISSORS); a control for display of the Opponent/Computer choice (ROCK, PAPER, OR SCISSORS); text items for the scores of the User for Wins, Losses, and Ties; a text item for the Winning Percentage of the User; the NEXT game button; the QUIT button; the ABOUT button; and any other controls you may feel are appropriate. 2. Connect the R/P/S buttons for the User to the second (update) script. This update script performs most of the work. The User selects one R/P/S button; turn "off" the other two not selected by the User. Generate the selection for the Opponent and indicate this in the GUI. Determine the outcome and increment the score as appropriate. Update the display of the score as well as the User's winning percentage (e.g., 2 wins, O losses, and 1 tie would be a winning percentage of 66%). Note: the controls should not react when "accidentally" selected by the User. 3. The NEXT button resets all of the R/P/S buttons to their initial states to prepare for the next "round" (and leaves the score as is). This is implemented in the third (reset) script. 4. The QUIT button closes the window. 5. You may implement other features as well. For example, coloring to indicate a win/loss/tie, etc. 6. Place a comment at the top of the first file that states the purpose and simple description of use. Include your name as the Author of the code. When testing, try to "break" the code 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