Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Gather! solution in Clear category for Army Units by veky
class Army:
def train_swordsman(army, name): return Swordsman(army, name)
def train_lancer(army, name): return Lancer(army, name)
def train_archer(army, name): return Archer(army, name)
class Soldier:
def __init__(soldier, army, name):
soldier.descent, soldier.name = army.descent, name
soldier.title = getattr(army, soldier.category)
def introduce(self):
return f'{self.title} {self.name}, {self.descent} {self.category}'
class Swordsman(Soldier): category = 'swordsman'
class Lancer(Soldier): category = 'lancer'
class Archer(Soldier): category = 'archer'
class AsianArmy(Army):
descent = 'Asian'
swordsman, lancer, archer = 'Samurai', 'Ronin', 'Shinobi'
class EuropeanArmy(Army):
descent = 'European'
swordsman, lancer, archer = 'Knight', 'Raubritter', 'Ranger'
June 22, 2018
Comments: