import random
import time
mylist = [1, 2, 3]
print("Welcome to the Stone-Paper-Scissor game.")
print("\nHere are some of the rules")
print("1.) There will be five round. The one whose score is more will be declared as winner.")
print("1.) For Stone, simply press 1.")
print("2.) For Paper, simply press 2.")
print("3.) For Scissor, simply press 3.")
print("\nNow, Lets go!")
i = 0
j = 0
k = 1
for k in range(1, 6):
print("\nROUND ", k)
y = int(input("\nEnter your choice as 1, 2 and 3 as instructed above: "))
m = random.choice(mylist)
if y==1:
if m==1:
print("\nTie")
elif m==2:
print("\nComputer chose paper, so you lose. Try again.")
j = j+1
elif m==3:
print("\nYou win!")
i = i+1
elif y==2:
if m==2:
print("\nTie")
elif m==1:
print("\nComputer chose stone, so you lose. Try again.")
j = j+1
elif m==3:
print("\nYou win!")
i = i+1
elif y ==3:
if m==3:
print("\nTie")
elif m==2:
print("\nComputer chose stone, so you lose. Try again.")
j = j+1
elif m==1:
print("\nYou win!")
i = i+1
print("SCORECARD")
print("Your score is: ", i)
print("Apponent's score is: ", j)
if i>j:
print("\nYou are in a lead with", i-j, "scorepoints.")
elif i==j:
print("\nYou both have same score.")
elif i<j:
print("\nComputer is leading with", j-i, "scorepoints.")
print("*********************************************************************************************")
k = k+1
print("..............................................................................................")
if i>j:
print("\nYOU WON THE SERIES!")
elif i==j:
print("\nYou both have same score. Can't decide the winner.")
elif i<j:
print("\nComputer won! Try again.")
print("\n")
time.sleep(60)
John Veer
Contact mail id - john.veer.utube@gmail.com
Comments
Post a Comment