|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--Maze.MazeUtil
Utility methods for working with mazes using the Maze class.
| Field Summary | |
static int |
BORDERED
Represents the value of the type parameter to generate a bordered (box) maze. |
static int |
EMPTY
Represents the value of the type parameter to generate an empty maze. |
static int |
GRIDDED
Represents the value of the type parameter to generate a grid maze. |
static int |
RANDOM
Represents the value of the type parameter to generate a random maze. |
static double |
WALL_WEIGHTING
Represents the weighting of walls to doors in randomly generated mazes. |
| Constructor Summary | |
MazeUtil()
Creates a new instance of MazeUtil |
|
| Method Summary | |
static Maze.Maze |
generate(int width,
int height,
int type)
Generates a maze of a given width, height and type. |
static Maze.Maze |
getMaze()
Get the solved maze |
static void |
main(java.lang.String[] args)
Starts the class in a special testing mode. |
static boolean |
optimize()
Attempts to optimize the recommended path through the maze to minimize steps and the number of options available. |
static int |
solve(Maze.Maze myMaze)
Attempts to recursively solve the maze from (0,0) to (width - 1, height - 1) |
static boolean |
verify(Maze.Maze myMaze)
Verifies the maze as safe for solving. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int EMPTY
public static final int RANDOM
public static final int BORDERED
public static final int GRIDDED
public static final double WALL_WEIGHTING
| Constructor Detail |
public MazeUtil()
| Method Detail |
public static Maze.Maze generate(int width,
int height,
int type)
width - the number of columns in the mazeheight - the number of rows in the mazetype - the type of maze to generate.
Can be any of the constants EMPTY, RANDOM, BORDERED or GRIDDED.
public static boolean verify(Maze.Maze myMaze)
myMaze - the maze to be verified
public static int solve(Maze.Maze myMaze)
myMaze - the maze to solve
public static boolean optimize()
public static Maze.Maze getMaze()
public static void main(java.lang.String[] args)
args - command line arguments (ignored)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||