while True:
enemies = hero.findEnemies()
enemy = hero.findNearest(enemies)
friends = hero.findFriends()
# Send the first soldier of the friends array towards the enemy.
for i in range(0, len(friends)):
friend = friends[1]
hero,command(friend, "move", {"x":16,"y":16})
pass
# i in range(1, n) starts the index at the second element!
for i in range(1, len(friends)):
friend = friends[i]
# Command the remaining soldiers to run away!
hero.command(friend, "move", {"x":30, "y":36})
only one of the soldiers go to the bomb and it only explodes one bomb
which is making that line of code not work. However, have another look at the two lines above it. You’re only trying to command one soldier, so you don’t need the for loop to go through all of them.