Bug:Computer Science 3(Python) Challenge-Friendly Minefield

In Computer Science 3(Python) Challenge-Friendly Minefield, the enemy at the bottom will not leave when I close to it.
while True:
enemy = hero.findNearestEnemy()
if enemy.pos.y > hero.pos.y:
hero.moveXY(hero.pos.x, hero.pos.y + 4)
enemy = hero.findNearestEnemy()
if enemy.pos.y < hero.pos.y:
hero.moveXY(hero.pos.x, hero.pos.y - 4)
else:
hero.moveXY(hero.pos.x + 12, hero.pos.y)

Hi @VegBird an welcome to the forum! :partying_face:

Can you format your code as it is described below and can you also send us a link to the level?

Andrei

1 Like