Zaayd

Python RPS Game II

Mar 15th, 2021 (edited)
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.84 KB | None | 0 0
  1. import random
  2. print("Winning Rules of the Rock paper scissor game as follows: \n"
  3.                                 +"Rock vs paper->paper wins \n"
  4.                                 + "Rock vs scissor->Rock wins \n"
  5.                                 +"paper vs scissor->scissor wins \n")
  6.  
  7.  
  8. gameR = 0
  9. start = "===============START==============="
  10. end = "================END================"
  11. print("\n")
  12. print(start)
  13.  
  14. while True:
  15.     victory = ["Winner Winner Chiken Diner!!","Winner!!"]
  16.     lose = ["lose!!" , "loser!!"]
  17.     game = ['Scissor','Paper','Rock']
  18.     lo = random.choice(lose)
  19.     vi = random.choice(victory)
  20.     print(gameR)    
  21.     print("Enter choice \n 1. Rock \n 2. Paper \n 3. Scissor \n")
  22.     #Player Choice
  23.     choice = int(input("User turn: "))
  24.     while choice > 3 or choice < 1:
  25.       choice = int(input("enter valid input: "))
  26.     if choice == 1:
  27.       playerC = 'Rock'
  28.     if choice == 2:
  29.       playerC = 'Paper'
  30.     if choice == 3:
  31.       playerC = 'Scissor'
  32.     print("Player Choice Is : " + playerC)
  33.     #Pc choice
  34.     print("Pc Turn" + "\n")
  35.     pc = random.choice(game)
  36.     print("Pc Choice Is : " + pc)
  37.     print(pc + " V/s " + playerC)
  38.     #Winer?Loser?
  39.     if playerC == pc:
  40.       print("Tie")
  41.     if playerC == "Rock" and pc == "Paper":
  42.       print(lo)
  43.     if playerC == "Rock" and pc == "Scissor":
  44.       print(vi)
  45.     if playerC == "Paper" and pc == "Rock":
  46.       print(vi)
  47.     if playerC == "Paper" and pc == "Scissor":
  48.       print(lo)
  49.     if playerC == "Scissor" and pc == "Rock":
  50.       print(lo)
  51.     if playerC == "Scissor" and pc == "Paper":
  52.       print(vi)
  53.     ans = input("play Again? (Y/N) : ")
  54.     if ans == "Y" or ans == "y" or ans == "yes" or ans == "YES" :
  55.       print("Retry")
  56.       continue
  57.     elif ans == ("N" or "n" or "NO" or "no"):
  58.       print("Thx For Playing")
  59.       break
  60.     else:
  61.       input("Enter Your Ans : (Y/N) ")
  62. print("\n")
  63. print(end)
Add Comment
Please, Sign In to add comment