This is the code and notes from my live Twitch programming and drawing classes.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

15 lines
414 B

from ex50 import Person
def test_combat():
boxer = Person("Boxer", 100, 10)
zombie = Person("Zed", 1000, 1000)
# these asserts are bad, fix them
assert boxer.hp == 100, "Boxer has wrong hp."
assert zombie.hp == 1000, "Zombe has wrong hp."
boxer.hit(zombie)
assert zombie.alive(), "Zombie should be alive."
zombie.hit(boxer)
assert not boxer.alive(), "Boxer should be dead."