print(“Rules:-\nSnake vs. Water: Snake drinks the water hence wins.\nWater vs. Gun: The gun will drown in water, hence a point for water\nGun vs. Snake: Gun will kill the snake and win.\n”)
print(“Option:-\n[S] – snake\n[W] – water\n[G] – gun\n”)
t=0
cho=[“S”,”W”,”G”]
u_p,b_p,t_p,w_v=0,0,0,0
while t<10:
t+=1
usr = input("Enter Your choice\n")
bot=random.choice(cho)
if bot==usr:
t_p+=1
print(f"Computer : {bot}")
print("Tie")
elif usr=="S" and bot=="W":
u_p+=1
print(f"Computer : {bot}")
print("You win")
elif usr=="S" and bot=="G":
b_p+=1
print(f"Computer : {bot}")
print("You loss")
elif usr=="W" and bot=="S":
b_p+=1
print(f"Computer : {bot}")
print("You loss")
elif usr=="W" and bot=="G":
u_p+=1
print(f"Computer : {bot}")
print("You win")
elif usr=="G" and bot=="S":
u_p+=1
print(f"Computer : {bot}")
print("You win")
elif usr=="G" and bot=="W":
b_p+=1
print(f"Computer : {bot}")
print("You loss")
else:
w_v+=1
print("Please Enter Correct Choice :-|")
2 responses to “HOME”
Rootuser@smart
LikeLiked by 1 person
import random
print(“Rules:-\nSnake vs. Water: Snake drinks the water hence wins.\nWater vs. Gun: The gun will drown in water, hence a point for water\nGun vs. Snake: Gun will kill the snake and win.\n”)
print(“Option:-\n[S] – snake\n[W] – water\n[G] – gun\n”)
t=0
cho=[“S”,”W”,”G”]
u_p,b_p,t_p,w_v=0,0,0,0
while t<10:
t+=1
usr = input("Enter Your choice\n")
bot=random.choice(cho)
if bot==usr:
t_p+=1
print(f"Computer : {bot}")
print("Tie")
elif usr=="S" and bot=="W":
u_p+=1
print(f"Computer : {bot}")
print("You win")
elif usr=="S" and bot=="G":
b_p+=1
print(f"Computer : {bot}")
print("You loss")
elif usr=="W" and bot=="S":
b_p+=1
print(f"Computer : {bot}")
print("You loss")
elif usr=="W" and bot=="G":
u_p+=1
print(f"Computer : {bot}")
print("You win")
elif usr=="G" and bot=="S":
u_p+=1
print(f"Computer : {bot}")
print("You win")
elif usr=="G" and bot=="W":
b_p+=1
print(f"Computer : {bot}")
print("You loss")
else:
w_v+=1
print("Please Enter Correct Choice :-|")
print()
a=f"Your points : {u_p}"
b=f"Bot points : {b_p}"
c=f"Tie : {t_p} times"
d=f"Wrong values : {w_v}"
print(f"{a}\n{b}\n{c}\n{d}")
if u_p<b_p:
print("YOU LOSS THE GAME :(")
else:
print("YOU WON THE GAME :)")
#chek my code
LikeLiked by 1 person