# Get all your troops to the end of the path by passing over the mines.
# You can locate duds by finding the mines that have a value that is a prime number.
# Check the guide for clarification.
def prime():
for n in Math.ceil(Math.sqrt(2)):
if n % 2 == 0:
return False
else:
return True
for n in Math.ceil(Math.sqrt(3)):
if n % 3 == 0:
return False
else:
return True
for n in Math.ceil(Math.sqrt(7)):
if n % 7 == 0:
return False
else:
return True
if n == True:
friends = hero.findFriends()
for friend in friends:
hero.command(friend, "move", n)
while True:
prime()
# Get all your troops to the end of the path by passing over the mines.
# You can locate duds by finding the mines that have a value that is a prime number.
# Check the guide for clarification.
def prime():
for n in range(Math.ceil(Math.sqrt(2))):
if n % 2 == 0:
return False
else:
return True
for n in range(Math.ceil(Math.sqrt(2))):
if n % 3 == 0:
return False
else:
return True
for n in range(Math.ceil(Math.sqrt(2))):
if n % 7 == 0:
return False
else:
return True
if n == True:
friends = hero.findFriends()
for friend in friends:
hero.command(friend, "move", n)
while True:
prime()
Now there is no error but my hero just stands there and does nothing and eventually ran out of time.
Lydia
There are no commands to make your hero to move. Also I’m not sure what your function `prime’ does. It should take an argument and return True or False if the number is a prime one or not. Still it just a small part of the solution, because you need to do a lot there.