Question
Write an algorithm for a Rock Paper Scissors game. The user should enter either rock, or paper, or scissors while the computer makes its choice
Write an algorithm for a Rock Paper Scissors game. The user should enter either rock, or paper, or scissors while the computer makes its choice randomly. The two choices are then compared with the user being told whether they won, lost, or tied. For this game Rock beats Scissors, which beats Paper, which beats Rock. Include your algorithm as comments in your submission.
See here for an example of what an algorithm should look like.
If you submit python code instead on an algorithm you will not receive points for this question.
python for language
Algorithm Example For the following task: Use the random module to write a number guessing game. The number the computer chooses should change each time you run the program. Repeatedly ask the user for a number. If the number is different from the computer's let the user know if they guessed too high or too low. If the number matches the computer's, the user wins. Keep track of the number of tries it takes the user to guess it. An appropriate algorithm might be: mport the random module Display a welcome message to the user Choose a random number between1 and 100 Get a guess from the user Set a number of tries to 0 As long as their guess isn't the number Check if guess is lower than computer If so, print a lower message Otherwise, is it higher? fso, print a higher message Get another guess Increment the tries Repeat When they guess the computer's number, display the number and their tries count Notice that each line in the algorithm corresponds to roughly a line of code in Python, but there is no coding itself in the algorithm. Rather the algorithm lays out what needs to happen step by step to achieve the programStep 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