Question: You are given the method that simulates a rock,paper, scissors game move and a method to determine which player wins. Now, write in main the
You are given the method that simulates a rock,paper, scissors game move and a method to determine which player wins.
Now, write in main the logic to let a human play against the computer. The program prompts the user to choose a move. The program randomly pick a move for the computer. The program then checks to see who is the winner. It prints the winner. If no one wins, it goes to the next round and repeat until one player wins.
Sample run : human wins
Human against computer.
Your move rockpaper,scissors: rock
Computer's move: scissors
You win.
Sample run : computer wins.
Human against computer.
Your move rockpaper,scissors: rock
Computer's move: paper
Computer wins.
Sample run : many rounds, but computer wins.
Human against computer.
Your move rockpaper,scissors: rock
Computer's move: rock
No one wins. Another round.
Your move rockpaper,scissors: rock
Computer's move: rock
No one wins. Another round.
Your move rockpaper,scissors: paper
Computer's move: scissors
Computer wins.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
