[고1 프로그래밍] 09 - (6)
#일반 유닛 class Unit: def __init__(self, name, hp): self.name = name self.hp = hp print("{0} 유닛이 생성되었습니다.".format(self.name)) print("체력 : {0}, 공격력 : {1}".format(self.hp, self.damage)) #공격 유닛 class AttackUnit: def __init__(self, name, hp, damage): self.name = name self.hp = hp self.damage = damage def attack(self, location): print("{0} : {1} 방향으로 적군을 공격합니다. [공격력 {2}]"\ .format(self.name, location, s..
2023.09.27