Missing 1 Required Positional Argument: part5() Error - python

I am pretty much a beginner at Python and for my assignment I am creating a text based game and I want to make an item system. However, there is an error in part7a that says TypeError: part7a() missing 1 required positional argument: 'part5'.
I am unsure why the item_count is not carrying over and if someone could provide any kind of assisstance it would be greatly appreciated. Thanks!
def part5():
print("As you venture across the path, you reach a crossroads...")
time.sleep(1)
print("You stop at the crossroads as you are met with 3 different paths...")
time.sleep(2)
print("Something shiny on the floor catches your eye...")
time.sleep(2)
print("You look down and it appears to be an old sword with a blue gem in its core...")
answer = ""
while answer.lower().strip() != "yes" and answer.lower().strip() != "no":
answer = input("Take the sword? (yes/no): ")
if answer.lower().strip() == "yes":
item_count = 0
item_count = item_count + 1
time.sleep(1)
print("- Item added to your backpack -")
time.sleep(2)
print("You pick up the sword, now it's time to make your decision.")
time.sleep(2)
part6()
elif answer.lower().strip() == "no":
time.sleep(2)
print("You think nothing of the sword and carry on to make your decision.")
time.sleep(2)
part6()
return
def part6():
answer = ""
while answer != "1" and answer != "2" and answer != "3":
answer = input("What path will you choose? (1/2/3): ")
battleAnswer = "2"
if answer == battleAnswer:
time.sleep(2)
print("You head down path", answer+"...")
part7a()
else:
time.sleep(2)
print("You head down path", answer+"...")
part7b()
return
def part7a(part5):
time.sleep(2)
print("After travelling for a while you find the path becoming darker...")
time.sleep(2)
print("And darker...")
time.sleep(2)
print("Until...")
time.sleep(2)
print("A tall dark monster appears before you...")
time.sleep(2)
print("Lets hope you know what you're doing!!")
time.sleep(1)
answer = ""
while answer.lower.strip() != "yes" and answer.lower().strip() != "no":
answer = input("Fight the monster? (yes/no): ")
if answer == "yes" and item_count == 1:
time.sleep(2)
print("- Sword equipped from backpack -")
time.sleep(2)
print("You firmly grasp the sword in your hands...")
time.sleep(2)
print("It fills you with determination...")
time.sleep(2)
print("The monster charges towards you...")
time.sleep(2)
print("You run up with your sword, challenging the monster...")
time.sleep(1)
print("The monster accepts your challenge and begins running towards you...")
time.sleep(2)
print("Stomp, stomp, STOMP!!")
time.sleep(1)
print("SLICEEEEEEEE!")
time.sleep(2)
print("With a brave slash of your sword you slice through the monster...")
time.sleep(2)
print("You face monster that had been cut in two...")
time.sleep(2)
print("It looks you in the eye as it slowly fades away into dust.")
time.sleep(3)
part8()
else:
time.sleep(2)
print("In a brave effort you attempt to sprint around the monster...")
time.sleep(2)
print("It looks down at you and stomps on you as if you are an ant.")
time.sleep(2)
restart()
def part7b():
print('hello')

Related

how to make it that it does not repeat?

I know that a "not repeat with random from a list" is probably seen as a info you can find, but as someone who does not have a lot of knowledge of python yet, i cannot seem to understand those answers or they do not work for my problem. So I hope any of you are able to help.
as my first small project I am building a truth or dare program, and now I am at the point that I want to make it that the questions cannot be asked twice, and that if the truth questions are all done it prints that announcement, and I want the same for my dare questions.
here is my program so far, sorry if it is messy:
import random
import time
truth = ["If you could be invisible, what is the first thing you would do?",
"What is a secret you kept from your parents?",
"What is the most embarrassing music you listen to?",
"What is one thing you wish you could change about yourself?",
"Who is your secret crush?"]
dare = ["Do a free-style rap for the next minute",
"Let another person post a status on your behalf.",
"Hand over your phone to another player who can send a single text saying anything they want to anyone they want.",
"Let the other players go through your phone for one minute.",
"Smell another player's armpit."]
print("Hello, and welcome to my truth or dare show, just type truth or type dare to get a question!")
lives = 3
while lives > 0:
choice = input("truth or dare?: ").lower()
time.sleep(0.5)
if choice == "truth":
print(random.choice(truth))
time.sleep(0.5)
while True:
answer_truth = input("want to answer? type yes or no: ").lower()
if answer_truth == "yes":
input("> ").lower()
print("good answer")
time.sleep(0.5)
print(f"you have {lives} lives left")
break
elif answer_truth == "no":
print("you lost a life!")
time.sleep(1)
lives -= 1
print(f"you have {lives} lives left")
break
else:
print("that is not an option")
elif choice == "dare":
print(random.choice(dare))
time.sleep(0.5)
while True:
do_dare = input(f"did you do the dare? type yes or no: ").lower()
if do_dare == "yes":
print("well done!")
time.sleep(0.5)
print(f"you have {lives} lives left")
break
elif do_dare == "no":
print("you lost a life!")
lives -= 1
time.sleep(0.5)
print(f"you have {lives} lives left")
break
else:
print("that is not an option")
else:
print("that is not an option")
time.sleep(0.5)
print("GAME OVER!")
This should work:
choice = random.choice(truth)
time.sleep(0.5)
# inside the loop
truth.remove(choice)
if len(truth) == 0:
print("all questions are done")
do the same for dare
You probably want a construct like this:
from random import shuffle
ls = ["a", "b", "c"]
shuffle(ls)
lives = 3
while lives > 0 and ls:
current_question = ls.pop()
... # Rest of your code
So you want to select a random option, but then no longer have it in the set that you select random things from in the future.
If you imagine it physically, you have a jar list that has papers item's in it and you want to take them out at random. Obviously, any that you take out can not be taken out again.
We can accomplish this by removing the item from the list after it's 'picked'
To answer your question about having it let them know there are no more truths or no more dares, we can simply add a conditional to the whole truth segment and one to the whole dare segment as well, then further, if both run out, end the game.
while lives > 0 and (len(truth)>0 or len(dare>0)):
# Rest of the program
if choice == "truth":
if len(truth) > 0:
# Code
else:
print("there are no more truths (existential crisis), maybe try a dare instead")
elif choice == "dare":
if len(dare)>0:
# Code
else:
print("there are no more dares *sigh of releif*, maybe try a truth instead")

the input is not working in the second time

when an invalid answer (a number higher than 2) is given and is sent back to the intro(name) (see the else statement at the bottom) which is the introduction, the choise1 is auto completed and is redirected to crowbar()
def intro(name):#added the whole code
print( name + " you are in a back of a car hands tied, you can't remember anything apart the cheesy pizza you had for breakfast")
time.sleep(1)
print("you can see 2 men outside the car chilling out, they haven't seen that you have waken up")
time.sleep(1)
print("you figure out that your hands are not tied hard and manages to break free")
time.sleep(1)
print("and you see a piece of paper with your adress in it on the armrest in the middle of the front seats")
time.sleep(1)
print(" you see a crowbar under the back seat ")
time.sleep(1)
print("CHOOSE WISELY")
time.sleep(1)
print("""
1)grab the crowbar
2)check to see if the door was open""")
def car():
if choise1 == 1:
crowbar()
elif choise1 == 2:
door()
else:
print("that's not a valid answer")
intro(name)
choise1 = int(input("enter 1 or 2"))
car()
you can use function with parameter in this example (x )
def car(x):
if x == 1:
print("crowbar()")
elif x == 2:
print("door()")
else:
print("that's not a valid answer")
print("intro(name)")
choise1 = int(input("enter 1 or 2"))
car(choise1)

How can I return my code to the start of the code?

I've been trying to return my code to the beginning after the player chooses 'yes' when asked to restart the game. How do I make the game restart?
I've tried as many solutions as possible and have ended up with this code. Including continue, break, and several other obvious options.
import time
def start():
score = 0
print("Welcome to Atlantis, the sunken city!")
time.sleep(1.5)
print("You are the first adventurist to discover it!")
time.sleep(1.5)
print("Do you explore or talk to the merpeople?")
time.sleep(1.5)
print("Type 1 to explore Atlantis alone.")
time.sleep(1.5)
print("Type 2 to talk to the resident merpeople.")
start()
def surface():
print("You return to the surface.")
print("When you go back to Atlantis it's gone!")
print("Your findings are turned to myth.")
print("The end!")
print("Wanna play again?If you do, type yes! If you wanna leave, type no!")
score = -1
def castle():
print("The merpeople welcome you to their castle.")
print("It is beautiful and you get oxygen.")
print("Now that you have your oxygen, you can either go to the surface or explore Atlantis alone.")
score = 1
print("To explore alone enter 5. To go to the surface enter 6.")
def drowndeath():
print("You begin to explore around you.")
print("You avoid the merpeople who avoid you in return.")
print("But, OH NO, your oxygen begins to run out!")
print("You run out of air and die.")
print("Wanna play again?If you do, type yes! If you wanna leave, type no!")
score = 4
def merpeople():
print("The merpeople talk kindly to you.")
print("They warn you that your oxygen tank is running low!")
print("You can follow them to their castle or go back to the surface.")
print("Type 3 to go to the castle or 4 to go to the surface.")
score = 5
def alone():
print("You begin to explore alone and discover a secret caven.")
print("You go inside and rocks trap you inside!")
print("You die underwater.")
print("Wanna play again?If you do, type yes! If you wanna leave, type no!")
score = 6
def famous():
print("You come back to land with new discoveries!")
print("Everyone loves you and the two worlds are now connected!")
print("You win!")
print("Wanna play again?If you do, type yes! If you wanna leave, type no!")
def choice_made():
choice = input("Make your decision!\n ")
if choice == "1":
drowndeath()
elif choice == "2":
merpeople()
else:
print("Please enter a valid answer.")
choice_made()
choice_made()
def choice2_made():
choice2 = input("What do you do?\n ")
if choice2 == "4":
surface()
elif choice2 == "3":
castle()
elif choice2 == "yes":
start()
elif choice2 == "no":
exit()
else:
print("Please enter a valid answer.")
choice2_made()
choice2_made()
def choice3_made():
choice3 = input("Make up your mind!\n ")
if choice3 == "5":
alone()
if choice3 == "6":
famous()
else:
print("Please enter a valid answer.")
choice3_made()
choice3_made()
def restart_made():
restart = input("Type your answer!\n ")
if restart == "yes":
sys.exit()
elif restart == "no":
exit()
else:
print("Please choose yes or no!")
restart_made()
restart_made()
while True:
choice = input("Make your decision!\n ")
if choice == "1":
drowndeath()
elif choice == "2":
merpeople()
else:
print("Please enter a valid answer.")
choice_made()
choice_made()
while True:
choice2 = input("What do you do?\n ")
if choice2 == "4":
surface()
if choice2 == "3":
castle()
else:
print("Please enter a valid answer.")
choice2_made()
choice2_made()
while True:
choice3 = input("Make up your mind!\n ")
if choice3 == "5":
alone()
if choice3 == "6":
famous()
if choice3 == "1":
drowndeath()
if choice3 == "2":
merpeople()
else:
print("Please enter a valid answer.")
choice3_made()
choice3_made()
while True:
restart = input("Type your answer!\n ")
if restart == "yes":
sys.exit()
elif restart == "no":
exit()
else:
print("Please choose yes or no!")
restart_made()
restart_made()
I want for my code to restart completely when 'yes' is typed after given the option.
In general, if you want to be able to 'go back to the beginning' of something, you want to have a loop that contains everything. Like
while True:
""" game code """
That would basically repeat your entire game over and over. If you want it to end by default, and only restart in certain situations, you would do
while True:
""" game code """
if your_restart_condition:
continue # This will restart the loop
if your_exit_condition:
break # This will break the loop, i.e. exit the game and prevent restart
""" more game code """
break # This will break the loop if it gets to the end
To make things a little easier, you could make use of exceptions. Raise a RestartException whenever you want to restart the loop, even from within one of your functions. Or raise an ExitException when you want to exit the loop.
class RestartException(Exception):
pass
class ExitException(Exception):
pass
while True:
try:
""" game code """
except RestartException:
continue
except ExitException:
break
break
You have two main options.
First option: make a main function that, when called, executes your script once. Then, for the actual execution of the code, do this:
while True:
main()
if input("Would you like to restart? Type 'y' or 'yes' if so.").lower() not in ['y', 'yes']:
break
Second, less compatible option: use os or subprocess to issue a shell command to execute the script again, e.g os.system("python3 filename.py").
EDIT: Despite the fact this is discouraged on SO, I decided to help a friend out and rewrote your script. Please do not ask for this in the future. Here it is:
import time, sys
score = 0
def makeChoice(message1, message2):
try:
print("Type 1 "+message1+".")
time.sleep(1.5)
print("Type 2 "+message2+".")
ans = int(input("Which do you choose? "))
print()
if ans in (1,2):
return ans
else:
print("Please enter a valid number.")
return makeChoice(message1, message2)
except ValueError:
print("Please enter either 1 or 2.")
return makeChoice(message1, message2)
def askRestart():
if input("Would you like to restart? Type 'y' or 'yes' if so. ").lower() in ['y', 'yes']:
print()
print("Okay. Restarting game!")
playGame()
else:
print("Thanks for playing! Goodbye!")
sys.exit(0)
def surface():
print("You return to the surface.")
print("When you go back to Atlantis it's gone!")
print("Your findings are turned to myth.")
print("The end!")
def castle():
print("The merpeople welcome you to their castle.")
print("It is beautiful and you get oxygen.")
print("Now that you have your oxygen, you can either go to the surface or explore Atlantis alone.")
def drowndeath():
print("You begin to explore around you.")
print("You avoid the merpeople who avoid you in return.")
print("But, OH NO, your oxygen begins to run out!")
print("You run out of air and die.")
def merpeople():
print("The merpeople talk kindly to you.")
print("They warn you that your oxygen tank is running low!")
print("You can follow them to their castle or go back to the surface.")
def alone():
print("You begin to explore alone and discover a secret caven.")
print("You go inside and rocks trap you inside!")
print("You die underwater.")
def famous():
print("You come back to land with new discoveries!")
print("Everyone loves you and the two worlds are now connected!")
print("You win!")
def playGame():
print("Welcome to Atlantis, the sunken city!")
time.sleep(1.5)
print("You are the first adventurer to discover it!")
time.sleep(1.5)
print("Do you explore or talk to the merpeople?")
time.sleep(1.5)
ans = makeChoice("to explore Atlantis alone", "to talk to the resident merpeople")
if ans == 1:
drowndeath()
askRestart()
merpeople()
ans = makeChoice("to go to the castle", "to return to the surface")
if ans == 2:
surface()
askRestart()
castle()
ans = makeChoice("to return to the surface", "to explore alone")
if ans == 1:
famous()
else:
alone()
askRestart()
playGame()

Python Code keeps repeating the Input Value even when I try to "end" the code

Here is my code, if you play it, then you should see what's wrong. I am not for sure how to end the code once the player dies or wins. Play till the ending and look at the code so you can understand what may be the issue.
Thanks so much, here is the code:
def start ():
print ("Hello! Welcome to Prison Break!")
print (""""You are a very infamous spy working with a foreign government in the US. You are always successful and have never been caught...until now.""")
print ("You were captured by the FBI when you were walking down the street after a mission, and they jumped you.")
print ("You don't know what is happening!")
description_of_room()
def description_of_room ():
print ("You wake up in a prison cell. Everything seems very old, dust lies on the ground, untouched for years.")
print ("The room seems empty besides the cell bars, crumbling wall behind you, and a pile of rubble.")
room_1()
def room_1 ():
print("")
prompt_0()
def prompt_0 ():
prompt_0 = input("What do you do?.")
try:
if prompt_0 == "look":
print(" ")
description_of_room() # goes internally into room_1
if prompt_0 == "cell bars":
print("You examine the cell bars carefully.")
print("The bars are very old, a wrench could be able to rip them open")
room_1()
if prompt_0 == "rubble":
print("You closely examine the rubble. You see a metal rusty handle of something.")
print("You pull it easily out of the rubble, its a old wrench, maybe it could be used on the cell bars.")
options()
elif prompt_0 == "wall":
print("You examine the crumbling wall.")
print("It is extremely old, it seems someone has cut away at it, making it delicate, a hammer could easily take care of it.")
room_1()
else:
print("Please type in cell bars, wall, rubble, or look")
room_1()
except ValueError():
print("ARE YOU CRAZY? DON'T TYPE NUMBERS! YOU'LL CRASH MY GAME!")
print(" ")
room_1()
room_1()
options()
def options():
print()
prompt_1()
def prompt_1():
prompt_1 = input("Use wrench on bars or trade with Billy for a Hammer, who is next door.")
try:
if prompt_1 == "use wrench":
print("The wrench will be able to break open the cell bars.")
print("If you do it now you will be caught, you must wait till night.")
escape_2_mor()
if prompt_1 == "trade with billy":
print("Billy is the common trader in the prison, he will take pretty much anything.")
print("You give the rusty wrench to Billy and he gives you a decent small hammer, which can be used to smash the crumbly wall.")
failure()
elif prompt_1 == "Random":
print("RANDOM")
options()
else:
print("Type trade with billy or use on cell bars.")
options()
except ValueError():
print("NO NUMBERS!")
print(" ")
options()
def escape_2_mor():
print()
prompt_3()
def prompt_3():
prompt_3 = input("What do you do?")
try:
if prompt_3 == "wait":
print("You wait till night.")
escape_2_nih()
elif prompt_3 == "use wrench":
print("You were caught by the police, punishment is death.")
print("You died, Game Over!")
end()
else:
print("Type wait or use wrench")
escape_2_mor()
except ValueError():
print("I SAID NO NUMBERS")
print(" ")
escape_2_mor()
def escape_2_nih():
print()
prompt_4()
def prompt_4():
prompt_4 = input("It's midnight, you have the chance to use the wrench!")
try:
if prompt_4 == "use wrench":
print("You slowly break the old bars, the noise echoing throughout the halls.")
escape_2_nih_1()
elif prompt_4 == "wait":
print("You wait for no reason, it's morning again.")
escape_2_mor()
else:
print("Type use wrench or wait")
except ValueError:
print("Why do I even try...")
print(" ")
escape_2_nih()
def escape_2_nih_1():
print()
prompt_5()
def prompt_5():
prompt_5 = input("Your outside your cell bars, in a dark hallway, what do you do?")
try:
if prompt_5 == "crawl":
print("You get on your knees quietly, making sure no one can see you.")
print("You stick in the shadows and come across a guard.")
print("You hit him on the head with the wrench, luckily he is wearing a helmet, so he is just knocked out.")
escape_2_des
elif prompt_5 == "run":
print("You run quickly down the hallway, you see other cellmates sleeping.")
print("You almost reach the metal door at the end of the hallway, but a guard turns and sees you.")
print("He is so suprised that he fires his gun before you can attack him.")
print("You fall to the ground, everything goes dark, you died.")
end()
else:
print("Please type crawl or run")
escape_2_nih_1()
except ValueError:
print("Just stop")
escape_2_nih_1()
escape_2_des()
def escape_2_des():
print()
prompt_6()
def prompt_6():
prompt_6 = input("You press open the door and you see towering gates and a guard tower, what do you do?")
try:
if prompt_6 == "tower":
print("You see the tower, and slowly approach it. You reach the tower and see its made out of stone that can be easily climbed.")
print("You climb up the wall, and then reach the top. You can see that the tower is high enough to jump over the fence and escape.")
print("You take a huge leap and fall to the ground, you look behind you and see the fence and the prison.")
print("You have escaped the prison! You Win!")
end()
if prompt_6 == "fence":
print("You slowly approach the fence and put your hand on it to start climbing.")
print("You are quickly electrocuted by the electric fence, stopping your heart.")
print("You've lost!")
end()
else:
print("Type fence or tower")
escape_2_des()
except ValueError:
print("Your annoying")
escape_2_des()
def failure():
print()
prompt_7()
def prompt_7():
prompt_7 = input("You can now break open the crumbled wall")
try:
if prompt_7 == "break wall":
print("You hammer away at the wall, which is breaking down easily.")
print("All the sudden a guard comes up from behind and stares down at you.")
print("Hello Officer! How are you doing today?")
print("Please come with me inmate.")
print("He pulls you by the shoulders and walks you down into a different cell, a more clean and sturdy cell.")
print("He pushes you in and locks the cell bars behind you, you have failed and will never get out.")
end()
if prompt_7 == "wait":
print("You wait for no reason, good job!")
failure()
else:
print("Type wait or break wall")
except ValueError:
print("Whatever")
failure()
end()
def end():
print("Congrats you have either won or failed the game. I hope you enjoyed!")
print(" ")
print("Ignore the statement underneath, the code is being an idiot")
start()
It would be a huge help if anyone could help, thank you. I am not for sure if it's the input that is the issue or what, but it keeps repeating. You can use pycharm if you have it because that is what works for me, if it does not work in any of the other programs you may use to run python then just try to please use Pycharm because I know it works.
Your end function doesn't actually stop the code execution. what you need to do is this
import sys
#your code
#your code
#your code
def end():
print("Congrats you have either won or failed the game. I hope you enjoyed!")
print(" ")
print("Ignore the statement underneath, the code is being an idiot")
sys.exit()

Still new to python. So confused right now. How do I make this program work?

So I'm making a little game to teach myself how python works, and it's been okay up to this point, but now I'm completely stuck. I'm sure the logic and formatting of the if and while statement are all wrong, so I'd be happy if people could point me in the right direction - again, REALLY new to programming in general. I'll paste the code, then explain what I'm trying to make it do:
import random
import time
print("Welcome to the Dojo!")
print("You have three opponents; they are ready...")
print("Are you?")
print("*To view the rules, type 'rules' ")
print("*To view commands, type 'commands' ")
print("*To begin, type 'start' ")
while True:
userInput = (input())
# Rules
if userInput == "rules":
print("The rules in this Dojo are simple. Kill your opponent! Fight to the death! Show no mercy!")
print("Each opponent gets progressively more difficult, whether it be in terms of health or damage.")
print("To attack, type 'attack'")
print("May the better (luckier) warrior win")
# Commands - to be added
elif userInput == "commands":
print("Commands will be added soon!")
# Start
elif userInput == "start":
damage = random.randint(1, 50)
userHealth = int(100)
opponentHealth = int(100)
print("Your first opponent is Larry Schmidt. Don't sweat it, he'll be a piece of cake.")
time.sleep(3)
print("The battle will begin in")
time.sleep(1)
print("5")
time.sleep(1)
print("4")
time.sleep(1)
print("3")
time.sleep(1)
print("2")
time.sleep(1)
print("1")
time.sleep(1)
print("Fight!")
if userInput == "attack":
int(userHealth - damage)
print("You did %(damage) to Larry!")
# Invalid response
else:
print("Enter a valid response, young grasshopper.")
if userInput == "start" is True:
continue
If you run the program for yourself, everything is okay until you reach the "5, 4, 3, 2, 1, Fight!" part. Then when you type "attack," it gives you "Enter a valid response, young grasshopper." I understand why this is happening, because "attack" doesn't fall under "rules", "commands", or "start". I just don't get how I'm supposed to format it so that after I enter "attack", it actually proceeds and outputs the damage done, etc. I apologize if this is hard to understand, but I think if you run it for yourself, you'll understand what I'm having problems with. Honestly, something tells me I've messed up the if and while statements up entirely, but hey, I'm learning and having fun :P.
Thanks for any help.
You aren't asking for more input. It's guaranteed that the userInput will still be "start" at that point.
Your code would benefit greatly from the use of functions. You could really organize the code better that way.
def intro():
print("Welcome to the Dojo!")
print("You have three opponents; they are ready...")
print("Are you?")
print("*To view the rules, type 'rules' ")
print("*To view commands, type 'commands' ")
print("*To begin, type 'start' ")
def get_user_input():
user_input = (input())
while user_input not in ['rules', 'commands', 'start']:
print("valid commands are rules, commands and start")
user_input = (input())
return user_input
intro()
returned_user_input = get_user_input()
There are a lot of ways to do these things, and you'll get better with time. Mainly note that user_input only gets updated when you do this:
user_input = (input())
Which in your code was only done once.
The code you have in the "start" branch of the if conditional will only run once, and userInput will still be "start" at that point. The solution, wrap it in a loop. Maybe something like this:
elif userInput == "start":
userHealth = 100
opponentHealth = 100
print("Your first opponent is Larry Schmidt. Don't sweat it, he'll be a piece of cake.")
time.sleep(3)
print("The battle will begin in")
time.sleep(1)
print("5")
time.sleep(1)
print("4")
time.sleep(1)
print("3")
time.sleep(1)
print("2")
time.sleep(1)
print("1")
time.sleep(1)
print("Fight!")
while opponentHealth > 0 and userHealth > 0:
userInput = input()
if userInput == "attack":
damage = random.randint(1, 50)
opponentHealth = opponentHealth - damage
print("You did %d to Larry!" % damage)
The while loop will loop until the opponent has been defeated or until the user is defeated, but at the moment, there's no damage done to the user. I'll leave that part to you.

Categories