Hey! I’m really stuck with this level. Here is my code:
loop: coins = self.findItems() coinIndex = 0 nearest = None nearestDistance = 9999 while coinIndex < len(coins): coin = coins[coinIndex] coinIndex += 1 distance = self.distanceTo(coin) if distance < nearestDistance: nearest = coin nearestDistance = distance if nearest: self.moveXY(nearest.pos.x, nearest.pos.y)
My hero just runs into the mine. That’s the problem?