Skip to content

Value Error if player hp == 0 #12

Open
@pytonc

Description

@pytonc

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions