- Hello Explorer
- Walls 2
- The Maze
- 16 Enemies
Seek out the Enemy
- Attack and Retreat
poke can each take in a direction parameter:
If no Direction is passed in, they will default to Direction.RIGHT.Mutators / Actions
Explorer can do one action per turn.
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.
look()- Returns an Array of 3 Spaces in the designated Direction.
getSpace()- Returns the next Space on the board.
getHealth()- returns the value of
isEnemy()- returns true if the Space contains an Enemy, and false otherwise.
isKnight()- returns true if the Space contains a Knight, and false otherwise.
isArcher()- returns true if the Space contains an Archer, and false otherwise.
isWall()- returns true if the Space contains a Wall, and false otherwise.
Premium Content - Free Preview
You are in charge of a robot, the Java Explorer (♖), which will be on its own in a dangerous world. In each challenge, you need to fill in the Java method
play, which will be invoked on every turn of the game. The Explorer will be able to do one action each turn, and needs to reach the Goal (☆) within a certain number of turns.
Previously, the Java Explorer navigated a a simple 1-dimensional world, and could only go in 2 directions. Now it faces a 2D world and can go in 4 directions.