|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.almacha.achamaze.MazeSolvingAlgorithm
org.almacha.achamaze.FollowLeftWallAlgo
public class FollowLeftWallAlgo
An implementation of the "follow left wall" maze solving algorithm. This algorithm may not enable you to escape from the maze. This algorithm works by first going in a random direction until we find a wall. Then we follow that wall forever and hope (but that may not happen) we escape form the maze.
| Field Summary | |
|---|---|
private boolean |
followingWall
|
private Direction |
going
|
| Constructor Summary | |
|---|---|
FollowLeftWallAlgo(PlayerStateForMazeAlgo playerState)
|
|
| Method Summary | |
|---|---|
protected Direction |
decide()
This method decides in which direction the player should go. |
| Methods inherited from class org.almacha.achamaze.MazeSolvingAlgorithm |
|---|
getPlayerState, move |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private boolean followingWall
private Direction going
| Constructor Detail |
|---|
public FollowLeftWallAlgo(PlayerStateForMazeAlgo playerState)
| Method Detail |
|---|
protected Direction decide()
MazeSolvingAlgorithm
decide in class MazeSolvingAlgorithm
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||