hi. i do exactly what the lvl tells me to do but i still fail. here is my code:
def chooseTarget(friend):
enemies = hero.findEnemies()
witch = None
target = friend.findNearestEnemy()
for enemy in enemies:
if enemy.type == "witch":
witch = enemy
if friend.type == "soldier" and witch:
hero.command(friend, "attack", witch)
if friend.type == "archer" and target:
hero.command(friend, "attack", target)
while True:
friends = hero.findFriends()
for friend in friends:
chooseTarget(friend)
pass