Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- print("Winning Rules of the Rock paper scissor game as follows: \n"
- +"Rock vs paper->paper wins \n"
- + "Rock vs scissor->Rock wins \n"
- +"paper vs scissor->scissor wins \n")
- gameR = 0
- start = "===============START==============="
- end = "================END================"
- print("\n")
- print(start)
- while True:
- victory = ["Winner Winner Chiken Diner!!","Winner!!"]
- lose = ["lose!!" , "loser!!"]
- game = ['Scissor','Paper','Rock']
- lo = random.choice(lose)
- vi = random.choice(victory)
- print(gameR)
- print("Enter choice \n 1. Rock \n 2. Paper \n 3. Scissor \n")
- #Player Choice
- choice = int(input("User turn: "))
- while choice > 3 or choice < 1:
- choice = int(input("enter valid input: "))
- if choice == 1:
- playerC = 'Rock'
- if choice == 2:
- playerC = 'Paper'
- if choice == 3:
- playerC = 'Scissor'
- print("Player Choice Is : " + playerC)
- #Pc choice
- print("Pc Turn" + "\n")
- pc = random.choice(game)
- print("Pc Choice Is : " + pc)
- print(pc + " V/s " + playerC)
- #Winer?Loser?
- if playerC == pc:
- print("Tie")
- if playerC == "Rock" and pc == "Paper":
- print(lo)
- if playerC == "Rock" and pc == "Scissor":
- print(vi)
- if playerC == "Paper" and pc == "Rock":
- print(vi)
- if playerC == "Paper" and pc == "Scissor":
- print(lo)
- if playerC == "Scissor" and pc == "Rock":
- print(lo)
- if playerC == "Scissor" and pc == "Paper":
- print(vi)
- ans = input("play Again? (Y/N) : ")
- if ans == "Y" or ans == "y" or ans == "yes" or ans == "YES" :
- print("Retry")
- continue
- elif ans == ("N" or "n" or "NO" or "no"):
- print("Thx For Playing")
- break
- else:
- input("Enter Your Ans : (Y/N) ")
- print("\n")
- print(end)
Add Comment
Please, Sign In to add comment