I am making a rock, paper scissors game form application and the code runs. However i can't seem to get it to work properly. The user will type either paper, scissors or rock, then the computer would choose one of those three as well from the options list. It sometimes says you won, however you really lost. What is wrong with this code?
from sys import exit
from time import sleep
from random import choice
options = ["rock", "paper", "scissors"]
print("rock")
sleep(0.5)
print("paper")
sleep(0.5)
print("scissors")
sleep(0.5)
user_move = input("shoot: ")
cpu_move = choice(options)
print(cpu_move)
if cpu_move == "rock":
if user_move == "rock" or "r":
print("Tie!")
exit(0)
elif user_move == "paper" or "p":
print("You Lose!")
exit(0)
elif user_move == "scissors" or "s":
print("You Win!")
exit(0)
else:
print("error")
exit(1)
elif cpu_move == "paper":
if user_move == "rock" or "r":
print("You Win!")
exit(0)
elif user_move == "paper" or "p":
print("Tie!")
exit(0)
elif user_move == "scissors" or "s":
print("You Lose!")
exit(0)
else:
print("error")
exit(1)
elif cpu_move == "scissors":
if user_move == "rock" or "r":
print("You Lose!")
exit(0)
elif user_move == "paper" or "p":
print("You Win!")
exit(0)
elif user_move == "scissors" or "p":
print("Tie!")
exit(0)
else:
print("error")
exit(1)
else:
print("error")
exit(1)