Guest User

Game

a guest
Feb 17th, 2025
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | Gaming | 0 0
  1. import random
  2. import os
  3. import time
  4.  
  5. while True:
  6. print("\nWelcome to Rock-Paper-Cats Game")
  7. print("1. Rock")
  8. print("2. Paper")
  9. print("3. Cat")
  10. print("4. Exit")
  11. choice = int(input("Enter Your Choice:"))
  12.  
  13. if (choice == 4):
  14. break;
  15.  
  16. choices = ["Rock", "Paper", "Cat"]
  17. computer_choice = random.choice(choices)
  18. user_choice = choices[choice - 1]
  19.  
  20. print("\nComputer' choice is: ", computer_choice)
  21. print("Your Choice is: ", user_choice)
  22.  
  23. if (user_choice == 'Rock' and computer_choice == 'Cat') or (user_choice == 'Paper' and computer_choice == 'Rock') or (user_choice == 'Cat' and computer_choice == 'Paper'):
  24. print("\nCongratulations, You Won!")
  25. elif (user_choice == 'Rock' and computer_choice == 'Paper') or (user_choice == 'Paper' and computer_choice == 'Cat') or (user_choice == 'Cat' and computer_choice == 'Rock'):
  26. print("\nComputer Wins!")
  27. else:
  28. print("\nIt's a Tie!")
  29.  
  30. time.sleep(3)
  31. os.system('cls' if os.name == 'nt' else 'clear')
  32. #If youre reading this, fuck you
  33. # Love, Cat
  34.  
Add Comment
Please, Sign In to add comment