A fine mint Python

You only find a single enemy at the very start of your code execution.

Read it out loud:

  1. You define pickUpCoin.
  2. You find the nearest enemy.
  3. You define attackEnemy.
  4. You start a while-true loop.
  5. You call attack enemy
  6. You check if enemy exists.
  7. You attack enemy.
  8. You call pick up coin.
  9. You find nearest coin.
  10. You check if coin exists.
  11. You move to the coin.
  12. Repeat (while-true loop)

Look at step #2.

1 Like