Advertisement
empirical518

Rock Paper Scissors by u/Lbifreal

Jun 23rd, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. import random
  2.  
  3. move = 0
  4. move = input("Make your move. Type either rock (r), paper (p), or scissors (s).")
  5. computerMove = random.randint(1, 3)
  6.  
  7. # all userMoves are equalling 1. Why ?
  8. if move == "rock" or "r":
  9. userMove = 1
  10. elif move == "paper" or "p":
  11. userMove = 2
  12. elif move == "scissors" or "s":
  13. userMove = 3
  14. else:
  15. print("ERROR")
  16.  
  17. print("User move is " + str(userMove))
  18. print("Computer move is " + str(computerMove))
  19.  
  20. if computerMove == userMove:
  21. print("It is a tie. Both players selected " + str(move))
  22. elif userMove == 1 and computerMove == 2:
  23. print("Rock loses to paper. Computer has earned one point.")
  24. elif userMove == 1 and computerMove == 3:
  25. print("Rock beats scissors. User has earned one point.")
  26. elif userMove == 3 and computerMove == 1:
  27. print("Scissors loses to rock. Computer has earned one point.")
  28. elif userMove == 3 and computerMove == 3:
  29. print("Scissors beats paper. User has earned one point.")
  30. elif userMove == 2 and computerMove == 3:
  31. print("Paper loses to scissors. Computer has earned one point.")
  32. elif userMove == 2 and computerMove == 1:
  33. print("Paper beats rock. User has earned one point.")
  34. else:
  35. print("ERROR")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement