# https://codecombat.com/play/level/antipodes
# The warlock used the "clone" spell and created evil antipodes of our archers.
# But even that evil spell has weakness.
# If your archer touches his antipode, then it will disappear.
# If an archer touches the wrong clone or attacks one of them, then the clones start to fight.
# We can find antipodes by their names - they are each other's reverse.
# This function check two units whether they are antipodes or not.
def areAntipodes(unit1, unit2):
reversed1 = ""
for i in range(len(unit1.id) - 1, -1, -1):
reversed1 += unit1.id[i]
return reversed1 == unit2.id
friends = hero.findFriends()
enemies = hero.findEnemies()
# Find antipodes for each of your archers.
# Iterate all friends.
for friend in friends:
# For each of friends iterate all enemies.
for enemy in enemies:
# Check if the pair of the current friend and the enemy are antipodes.
if areAntipodes(friend, enemy):
# If they are antipodes, command the friend move to the enemy.
hero.command(friend, 'move', enemy.pos)
# When all clones disappears, attack the warlock.
hero.wait(20)
enemies = hero.findEnemies()
while len(enemies) == 1:
hero.attack(hero.findNearestEnemy())
question can you tell us what is going wrong, just so the community can help you. And for future reference don’t try to come and ask unless you literally feel like you cant do it and the only way to to reach out to the community because I have seen you have said nvm I I have figured it out 1-2
times already meaning your a really smart person so don’t give up, a you got this as you have got the solution before, but other than that have a wonderful rest of your day
1 Like
nvm i have figured out the solution
it was just running out of time but now i got the solution
1 Like
This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.