pytonc / udacity

Projects created by students of Udacity, the XXI century university.
50 stars 72 forks source link

Value Error if player hp == 0 #12

Open pytonc opened 12 years ago

pytonc commented 12 years ago

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)

alexkarpandrus commented 12 years ago

Check out my solution!