Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Speedy category for The Warriors by Akyn_Kozlov
class Warrior:
health = 50
attack = 5
is_alive = True
def Is_alive(self):
if self.health > 0:
self.is_alive = True
return self.is_alive
else:
self.is_alive = False
return self.is_alive
class Knight(Warrior):
attack = 7
def fight(unit_1, unit_2):
unit_2.health -= unit_1.attack
if unit_1.Is_alive() and unit_2.Is_alive(): fight(unit_2, unit_1)
return unit_1.Is_alive()
Oct. 11, 2018
Comments: