Apr-08-2017, 06:04 PM
Variables have scope. Within the scope of the battle function, you have not defined lair_enemy. The best way to do this is to pass a parameter to the function:
def test(arg): print(arg) test(801)Now, you define lair_enemy in your home function, so you will need to pass it as a parameter to the question function, and then have the question function pass it to the battle function. For more details, check out the function tutorial in my signature below.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures