Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Creative category for The Warriors by kazuki.h
class Warrior(object):
def __init__(self):
self.health=50
self.attack=5
self.is_alive=True
class Knight(Warrior):
def __init__(self):
super().__init__()
self.attack=7
def fight(unit_1, unit_2):
if unit_1.health>0:
unit_2.health-=unit_1.attack
unit_2.is_alive=unit_2.health>0
return not fight(unit_2,unit_1)
else:
return False
Jan. 15, 2020
Comments: