Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for The Warriors by thealfest1
class Warrior:
def __init__(self):
self.health = 50
self.attack = 5
def get_is_alive(self):
return self.health > 0
is_alive = property(get_is_alive)
class Knight(Warrior):
def __init__(self):
super(Knight, self).__init__()
self.attack = 7
def fight(u1, u2):
while u1.is_alive and u2.is_alive:
u2.health -= u1.attack
if u2.is_alive:
u1.health -= u2.attack
return u1.is_alive and not u2.is_alive
Jan. 8, 2019