Enemies!


Collapse Content

The explorer faces many enemies...

Fighting enemies can weaken the Explorer. Call explorer.getHealth() to check current health levels. Call explorer.recharge() to increase health.

Don't take more than 30 moves to reach the goal.

Explorer Methods

Accessors

  • getSpace() - Returns the next Space on the board.
  • getHealth() - returns the value of health.

Mutators

  • walk() - Moves the explorer forward (to the right) one Space.
  • poke() - Pokes the next space, causing damage to any Enemy there.
  • recharge() - Adds 9 to health.

Space methods

  • isEnemy() - returns true if the Space contains an Enemy, and false otherwise.

Challenge

Defeat all the enemies and reach the Goal!

Please sign in or sign up to submit answers.

Alternatively, you can try out Learneroo before signing up.

Comments

  • I can only poke, recharge or move once each turn. I am taking too long and dying with the same code so if I recharge less I will just die quicker or if I recharge more I will take longer. What am I missing?

  • You need to recharge enough to defeat the second enemy, but not too much. The Pawn had 40 energy to start off with.

  • Based on the raw output it looks like the pawn is getting recharged also.

  • The first two pawns took 4 pokes to kill but the third one is still alive after 11 pokes.

  • @Kendall's Explorer, never recharge while getting poked or you'll die slowly.

Contact Us
Sign in or email us at [email protected]