Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- move = 0
- move = input("Make your move. Type either rock (r), paper (p), or scissors (s).")
- computerMove = random.randint(1, 3)
- # all userMoves are equalling 1. Why ?
- if move == "rock" or "r":
- userMove = 1
- elif move == "paper" or "p":
- userMove = 2
- elif move == "scissors" or "s":
- userMove = 3
- else:
- print("ERROR")
- print("User move is " + str(userMove))
- print("Computer move is " + str(computerMove))
- if computerMove == userMove:
- print("It is a tie. Both players selected " + str(move))
- elif userMove == 1 and computerMove == 2:
- print("Rock loses to paper. Computer has earned one point.")
- elif userMove == 1 and computerMove == 3:
- print("Rock beats scissors. User has earned one point.")
- elif userMove == 3 and computerMove == 1:
- print("Scissors loses to rock. Computer has earned one point.")
- elif userMove == 3 and computerMove == 3:
- print("Scissors beats paper. User has earned one point.")
- elif userMove == 2 and computerMove == 3:
- print("Paper loses to scissors. Computer has earned one point.")
- elif userMove == 2 and computerMove == 1:
- print("Paper beats rock. User has earned one point.")
- else:
- print("ERROR")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement