Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Rock, Paper, Scissors G is a popular game played by kids, old and young. Both players simultaneously choose one of rock, paper, or scissors and
Rock, Paper, Scissors G is a popular game played by kids, old and young. Both players simultaneously choose one of "rock", "paper", or "scissors" and share their choice with their opponent using hand signals. The outcome of a game is determined by: - rock beats scissors (rock smashes scissors) - scissors beats paper (scissors cut paper) - paper beats rock (paper covers rock) - a tie occurs if both players choose the same option, e.g. both choose 'paper' Your assignment is to implement an interactive rock, paper, scissors game that allows a human to play against a computer. The human enters her choice and the computer randomly chooses a choice from "rock", "paper", "scissors". Specifically, your program should: 1. Allow the human player to play a possibly infinite number of games - continue playing until the human quits 2. Ask the human to enter, ' r ', ' p ', 's' for "rock", "paper", "scissors", or ' q ' to exit the game 3. Randomly choose 'rock', 'paper', or 'scissors' for the computer's move (see below for hints) 4. Compare the human's and computer's moves to determine the winner or a tie and report the result to the user 5. The game should continue until the human chooses to stop by entering ' q ' when asked for a move. Here's the output of my implementation as an example (Your output may differ)
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