Exercise: number guessing in sub

Take the solution of the improved number guessing game from examples/arrays/number_guessing.pl and change it so some parts of it will be functions.

Specifically you can create subs for

  • the moving of the spaceship
  • checking the hit

How would you indicate the need to 'last' from within the function?