Value Error if player hp == 0
pytonc opened this issue · comments
Traceback (most recent call last):
File "game.py", line 53, in
student.attack(enemies[0])
File "/udacity/classic-games/hello_class/classes.py", line 149, in attack
damage = (worst == best) and best or random.randrange(worst, best)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/random.py", line 217, in randrange
raise ValueError, "empty range for randrange() (%d,%d, %d)" % (istart, istop, width)
ValueError: empty range for randrange() (0,0, 0)
Check out my solution!