Ok, finally my soldiers move. But I don’t have enough time to run it

def Primes(trap):

for div in range (2,Math.ceil(Math.sqrt(trap.value))):

if trap.value % div == 0:

return False

self.say(trap.value)

return True

```
traps = self.findByType("fire-trap")
P = []
for trap in traps:
if Primes(trap):
P.append(trap)
traps2 = self.findByType("bear-trap")
G = []
for trap2 in traps2:
if Primes(trap2):
G.append(trap2)
loop:
nearest = self.findNearest(P)
if nearest:
hero.moveXY(hero.pos.x, nearest.pos.y)
friends = hero.findFriends()
friendIndex=0
for friend in friends:
friendIndex+=1
hero.command(friend, 'move', {"x":hero.pos.x+2,"y":hero.pos.y})
hero.wait(1)
while hero.pos.x != nearest.pos.x:
hero.move(nearest.pos)
friendIndex1=0
for friend in friends:
hero.command(friend, 'move', {"x":hero.pos.x-2,"y":hero.pos.y})
hero.wait(1)
hero.moveXY(hero.pos.x-10,hero.pos.y)
friendIndex2=0
for friend in friends:
friendIndex2+=1
hero.command(friend, 'move', {"x":hero.pos.x+2,"y":hero.pos.y})
hero.wait(1)
if hero.pos.x<11:
break
hero.moveXY(2, 14)
loop:
nearest = self.findNearest(P)
if nearest:
hero.moveXY(hero.pos.x, nearest.pos.y)
friends = hero.findFriends()
friendIndex=0
for friend in friends:
friendIndex+=1
hero.command(friend, 'move', {"x":hero.pos.x+4,"y":hero.pos.y})
hero.wait(1)
while hero.pos.x != nearest.pos.x:
hero.move(nearest.pos)
friendIndex1=0
for friend in friends:
hero.command(friend, 'move', {"x":hero.pos.x-4,"y":hero.pos.y})
hero.wait(1)
hero.moveXY(hero.pos.x+10,hero.pos.y)
friendIndex2=0
for friend in friends:
friendIndex2+=1
hero.command(friend, 'move', {"x":hero.pos.x-4,"y":hero.pos.y})
hero.wait(1)
`indent preformatted text by 4 spaces`
```