import random
user = input("You reconize this creture. The feared BaLaKe. Its weakness is 'rock', 'paper',''scissors' Are you willing to challenge him in a battle of Rock Paper Scissors? (ENTER)" )
print("ROARRRRRRRRRRRRRRRRRRR!!!!!")
Below is the function I want to loop when userhealth and dragonhealth <= 0. I want it to keep asking for input for rock, paper, or scissors and go through the conditions.
def fight(userhealth,dragonhealth):
dragon = random.choice(["r","p","s"])
user=input("Rock(r), Paper(p) or Scissors(s): ").lower()
print(dragon)
if user==dragon:
print("You both missed your attacks. Bruh ;-;")
elif is_win(user,dragon):
dragonhealth-=20
print("You hit BaLaKe! 20 DMG Done!!! :) ")
print("Your health: "+str(userhealth )+" HP")
print("BaLaKe\'s health: "+str(dragonhealth )+" HP")
else:
print("Ow! You got hit by BaLake. -20 HP :( ")
userhealth-=20
print("Your health: "+str(userhealth )+" HP")
print("BaLaKe\'s health: "+str(dragonhealth )+" HP")
def is_win(player,opponent):
if (player=="r" and opponent=="s") or (player=="s" and opponent=="p") or (player=="p" and opponent=="r"):
return True
fight(100,100)