import random
def check(n1,n2):
if n1==1 and n2==3 or n1==2 and n2==1 or n1==3 and n2==2:
return("YOU WON")
elif n1==n2:
return("ITS a Tie")
else:
return("Computer won")
def comp(ran):
if ran==1:
print("computer Choosed: rock")
elif ran==2:
print("computer Choosed: paper")
else:
print("computer Choosed: scissors")
def startgame():
p1 = int(input("Player: Press \n1.for rock \n2.for paper \n3.for scissors\n"))
p2 = random.randint(1,3)
comp(p2)
print(check(p1,p2))
def Decision(f):
if(f==1):
startgame()
else:
print("Invalid Input")
print("WELCOME TO ROCK PAPER SCISSORS GAME: ")
first=int(input("PRESS 1 to Start"))
Decision(first)
print("WELCOME TO ROCK PAPER SCISSORS GAME: ")
first=int(input("PRESS 1 to Start"))
Decision(first)
Subscribe to:
Posts (Atom)