I am having troubles with my code on prime pathing :
traps = self.findHazards() trapsIndex = 0 while trapsIndex < len(traps): trap = traps[trapIndex] for i in range (2,Math.ceil(Math.sqrt(trap.value))): if (trap.value % i) == 0: self.say("it's not a prime number") trapsIndex += 1 break else: self.move(trap.pos) trapsIndex += 1
I am erroring on line 6, the message is “put each command on a separate line”, and I can’t find why. Any idea ?
Is that because of the 2 loops ? I have no idea how to code this without it, if you have hints, they are welcome.