Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- playerChoice = int(input("1 for Rock, 2 for Paper and 3 for Scissors "))
- print(playerChoice) # 'Debug'
- isWinner = True
- while not isWinner:
- compChoice = random.randint(1, 3)
- # Conditions for player
- if playerChoice == 1 and compChoice == 2:
- print("Paper beats rock. You Lose!")
- isWinner = False
- elif playerChoice == 1 and compChoice == 3:
- print("Rock beats Scissors. You Win!")
- isWinner = True
- elif playerChoice == 2 and compChoice == 1:
- print("Paper beats rock. You win!")
- isWinner = True
- elif playerChoice == 2 and compChoice == 3:
- print("Rock beats Scissors. You Lose!")
- isWinner = False
- elif playerChoice == 3 and compChoice == 1:
- print("You lose!")
- isWinner = False
- elif playerChoice == 3 and compChoice == 2:
- print("You win!")
- isWinner = True
- else:
- print("Invalid Number or you Tied")
- isWinner = False
- # print("Game over")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement