Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. print("Time to play some RPS, motherfucker. (Use numbers 1, 2 or 3 to make your choice.")
  2. running = True
  3.  
  4. player2choosing = False
  5.  
  6. while running:
  7.  
  8. ##Player1choice
  9. a = input("Player one, choose:\n1. Rock\n2. Paper\n3. Scissors\n")
  10.  
  11. if a in ["1","2","3"]:
  12. a = int(a)
  13.  
  14. else:
  15. print("Please make a valid selection.")
  16. continue
  17. player2choosing = True
  18.  
  19. ##Player2choice
  20. while player2choosing:
  21. b = input("Player two, choose:\n1. Rock\n2. Paper\n3. Scissors\n")
  22.  
  23. if b in ["1","2","3"]:
  24. b = int(b)
  25.  
  26. else:
  27. print("Please make a valid selection.")
  28. continue
  29. player2choosing = False
  30.  
  31. ##Result
  32. if a == b:
  33. print("It's a fucking tie.")
  34. elif a == 1:
  35. if b == 3:
  36. print("Player one wins!")
  37. else:print("Player two wins!")
  38. elif a == 2:
  39. if b == 1:
  40. print("Player one wins!")
  41. else: print("Player two wins!")
  42. elif b == 2:
  43. print("Player one wins!")
  44. else: print("Player two wins!")
  45. newgame = True
  46. while newgame == True:
  47. answer = input("Do you want to play again? Y\\N")
  48. if answer.lower() == 'y':
  49. newgame = False
  50. if answer.lower() == 'n':
  51. newgame = False
  52. running = False
  53. else:
  54. print("Invalid input, please try again.")
  55. continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement