Python Forum
Please help me with this program
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Please help me with this program
#4
If you slay a creature, y is not changed. The loop only ends when y is not 0, so you have to change it to end the loop.

There are other problems with your program, too. This is not a good situation to use global. Good situations are so incredibly rare, that as a beginner you should just not use global. Use parameters to pass values to functions, and use return statements to get values out of functions. Also, you are doing the exact same thing with slime molds and goombas. The monNum variable should just be used to set the name and HP of the monster, and then just deal with the monster using those attributes.

You should really check out the text adventure tutorial. And use code tags.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Please help me with this program - by nilamo - Dec-16-2016, 10:38 PM
RE: Please help me with this program - by Larz60+ - Dec-16-2016, 10:39 PM
RE: Please help me with this program - by ichabod801 - Dec-16-2016, 10:40 PM
RE: Please help me with this program - by Larz60+ - Dec-16-2016, 10:42 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020