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.
getSpace()- Returns the next Space on the board.
getHealth()- returns the value of
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.
isEnemy()- returns true if the Space contains an Enemy, and false otherwise.
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.
Kendall PonderJun 18, 3:54 PM
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?
LearnerooJun 18, 5:27 PM
You need to recharge enough to defeat the second enemy, but not too much. The Pawn had 40 energy to start off with.
Kendall PonderJun 18, 6:30 PM
Based on the raw output it looks like the pawn is getting recharged also.
Kendall PonderJun 18, 6:31 PM
The first two pawns took 4 pokes to kill but the third one is still alive after 11 pokes.
LearnerooJun 18, 9:04 PM
@Kendall's Explorer, never recharge while getting poked or you'll die slowly.