1. Engineering
2. Computer Science
3. part b 100 points implement a rockpaperscissors game write a...

# Question: part b 100 points implement a rockpaperscissors game write a...

###### Question details

Part B (100 points): Implement a Rock-Paper-Scissors Game

• Write a Python script that allows a human player to play the Rock-Paper-Scissors game against the computer.
• To play the game, the human player chooses one of "rock," "paper," or "scissors." The computer also chooses, randomly with equal probability, one of these three plays.
• These phases determine the winner for each combination: "rock crushes scissors", "scissors cuts paper," and "paper covers rock."
• In this diagram, each arrow points from the winner to the user.
• If both the human and the computer choose the same play, there is a tie.
• Here is a sample script output. The human player's choices are shown in red.
Enter human play (rock, paper, scissors): paper
Computer plays rock.
Paper covers rock.
Human wins.
Score: Human 1, Computer 0.

Enter human play (rock, paper, scissors): scissors
Computer plays scissors.
Tie.
Score: Human 1.5, Computer 0.5.

Enter human play (rock, paper, scissors): scissors
Computer plays rock.
Rock crushes scissors.
Computer wins.
Score: Human 1.5, Computer 1.5.

• You can base your script on this pseudocode:
set human score to 0.0
set computer score to 0.0

while true

input human play with prompt
choose random number from 0, 1, or 2

if random number is 0
set computer play to rock
else if random number is 1
set computer play to paper
else if random number is 2
set computer play to scissors
end

if human plays rock and computer plays rock
Result is tie.
else if human plays rock and computer plays paper
Result is computer wins.
else if human plays rock and computer plays scissors
Result is human wins.
else if human plays paper and computer plays rock
Result is human wins.
else if human plays paper and computer plays paper
Result is tie.
else if human plays paper and computer plays scissors
Result is computer wins.
else if human plays scissors and computer plays rock
Result is computer wins.
else if human plays scissors and computer plays paper
Result is human wins.