Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Antipodes: Help!


Hello, I am a student and I have a problem with my code. My harchers move has kill the clones but my hero didn’t move.

def areAntipodes(unit1, unit2):
reversed1 = ""
for i in range(len( - 1, -1, -1):
reversed1 +=[i]
return reversed1 ==

friends = hero.findFriends()
enemies = hero.findEnemies()

for friend in friends:
for enemy in enemies:
if areAntipodes(friend, enemy):
hero.command(friend, ‘move’, enemy.pos)

enemies = hero.findEnemies()
while len(enemies) == 1:

Can you help me?


It takes some time for your troops to walk over. I bet that there is more than one enemy still alive when you check if len(enemies == 1)