from random import randint
from os import system
Outcomes = ["Rock","Paper","Scissors"]
Player1 = 'computer'
Player2 = input('Your name to enter the battle? =>')
Player1Score = 0
Player2Score = 0
def endgame():
print('Go again? y or n')
Var = input('would you like to go again? y, Y,n,N')
if Var == 'y' or Var == 'Y':
system('clear')
main()
elif Var == 'n' or Var == 'N':
print("have a good day")
else:
endgame()
def main():
Player2ANSW= Outcomes[randint(0,2)]
print("Pick the following")
print("1. Rock")
print("2. Paper")
print("3. Scissors")
Player1Select= int(input("Pick 1,2 or 3 =>")) - 1
Player1ANSW= Outcomes[Player1Select]
print('{} pick {}'.format(Player1, Player1ANSW))
print('{} pick {}'.format(Player2, Player2ANSW))
if Player1ANSW == Player2ANSW:
print('its a tie')
endgame()
elif Player1ANSW == "ROCK":
if Player2ANSW == "SCISSORS":
print('{} Wins!'.format(Player1))
endgame()
else:
print('{} Wins!'.format(Player2)) #player1ANSW = USERCHOICE
endgame()
elif Player1ANSW == "SCISSORS":
if Player2ANSW == 'paper':
print('{} Wins!'.format(Player1))
endgame()
else:
print('{} Wins!'.format(Player2))
endgame()
elif Player1ANSW == 'paper':
if Player2ANSW == 'Rock':
print('{} Wins!'.format(Player1))
endgame()
else:
print('{} Wins!'.format(Player2))
endgame()
else:
endgame()
main()