How to make stone/paper/scissor game using python
import random
print("WELCOME TO THE GAMMING WORLD!")
list=["stone","paper","scissor"]
_my_score_=0
_AI_score_=0
_round_=1
while(True):
if _round_<=10:
_round_=_round_+1
ai=random.choice(list)
your_choice=input("Enter your choice(stone/paper/scissor): \n")
print(ai)
if your_choice==ai:
print("IMPRESSIVE ARE YOU AFRAID OF LOOSING\n YOUR SCORE:",_my_score_,
"AI score:",_AI_score_)
elif your_choice=="stone" and ai=="paper":
_AI_score_=_AI_score_+1
print("NOOBIE \n YOUR SCORE:",_my_score_,"AI score:",_AI_score_)
elif your_choice=="stone" and ai=="scissor":
_my_score_=_my_score_+1
print("GREAT \n YOUR SCORE:",_my_score_,"AI score:",_AI_score_)
elif your_choice=="paper" and ai=="stone":
_my_score_=_my_score_+1
print("GREAT \n YOUR SCORE:",_my_score_,"AI score:",_AI_score_)
elif your_choice=="paper" and ai=="scissor":
_AI_score_=_AI_score_+1
print("NOOBIE \n YOUR SCORE:",_my_score_,"AI score:",_AI_score_)
elif your_choice=="scissor" and ai=="paper":
_my_score_=_my_score_+1
print("GREAT \n YOUR SCORE:",_my_score_,"AI score:",_AI_score_)
elif your_choice=="scissor" and ai=="stone":
_AI_score_=_AI_score_+1
print("NOOBIE \n YOUR SCORE:",_my_score_,"AI score:",_AI_score_)
else:
print("invalid input")
else:
print("GAME OVER")
yes_no=input("Do you wanna continue! \n")
if yes_no=="yes":
print("GETTING ADDICTED! huh")
_round_=1
elif yes_no=="no":
print("BYEE")
break
else:
print("invalid input")
break
Comments
Post a Comment