My hero just runs into the mines

```
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)
```