Skip to content

Pyr0x1/maze

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maze

A maze generator written in Java.

Usage

Currently, two algorithms are implemented: Depth First and Prim. You can create a maze with the following lines of code (an example main is provided as well)

DepthFirstGenerator DFGen = new DepthFirstGenerator();
Maze maze = DFGen.generate(10, 20);
System.out.println(maze); 
PrimGenerator PGen = new PrimGenerator();
Maze maze = PGen.generate(10, 20);
System.out.println(maze);

The output will be something like this:

+ + + + + + + + + + + + + + + + + + + + +
+                       +       +       +
+   +   + + + + +   + + + + +   +   +   +
+   +       +   +   +               +   +
+   +   + + +   + + +   +   +   +   + + +
+   +                   +   +   +       +
+ + +   +   +   +   + + + + + + + + +   +
+       +   +   +                   +   +
+ + +   + + +   +   +   +   + + + + +   +
+           +   +   +   +           +   +
+ + + + + + + + + + + + + + + + + + + + +

It is also possible to get a boolean representation of the maze (true for walls, false for floors), by calling

maze.toBoolean();

About

A maze generator written in Java

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages