Respuesta :
Answer:
Explanation:
The following program is written in Python and follows all the instructions accordingly to create the rock paper scissor game as requested.
from random import randint
answers = ["Scissors", "Rock", "Paper"]
computer = answers[randint(0, 2)]
continue_loop = False
while continue_loop == False:
player_choice = input("Choose a number, 0 = Scissors, 1 = Rock , 2 = Paper?")
player_choice = answers[int(player_choice)]
if player_choice == computer:
print("Tie!")
elif player_choice == "Rock":
if computer == "Paper":
print("You lose!", computer, "covers", player_choice)
else:
print("You win!", player_choice, "smashes", computer)
elif player_choice == "Paper":
if computer == "Scissors":
print("You lose!", computer, "cut", player_choice)
else:
print("You win!", player_choice, "covers", computer)
elif player_choice == "Scissors":
if computer == "Rock":
print("You lose...", computer, "smashes", player_choice)
else:
print("You win!", player_choice, "cut", computer)
else:
print("That's not a valid play. Check your spelling!")
continue_or_not = input("Would you like to play again? Y/N")
continue_or_not = continue_or_not.lower()
if continue_or_not != "y":
break
computer = answers[randint(0, 2)]