Skip to content

timmyjose-projects/dsuf_maze

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maze Generation using Disjoint Sets

This is a simple experiment in generating a maze using the Disjoint Set Union Find data structure.

This implementation connects random "cells" of the maze with one of its neighbours, randomly chosen, till such time as the starting (top-left) and ending (bottom-right) cells are connected.

The output should work with any Unix-like system terminal. The implementation specifically uses ANSI Escape Codes for rendering the maze onto the screen.

Demo

$ mvn clean && mvn compile

$ mvn exec:java -Dexec.mainClass=com.z0ltan.dsuf_maze.App -Dexec.args="27 19"


     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
     |           |   |                                       |                   |
     +   +---+   +   +   +   +   +---+---+   +   +   +   +   +   +---+---+   +   +
     |   |   |       |                       |                                   |
     +   +   +   +   +   +---+---+   +---+   +   +   +   +   +   +   +   +   +   +
     |       |                       |               |                       |   |
     +   +   +   +   +   +   +   +   +   +   +---+   +---+   +   +---+   +---+   +
     |           |   |                                           |   |   |       |
     +   +   +   +   +   +   +   +   +   +   +   +   +   +   +---+   +---+---+---+
     |                           |   |                                   |   |   |
     +   +   +   +---+   +   +   +   +   +   +   +   +   +   +   +   +   +   +   +
     |       |                   |                       |       |               |
     +   +   +   +   +   +   +   +---+   +   +---+   +   +   +   +---+---+   +   +
     |   |                               |   |               |   |               |
     +   +   +   +---+---+   +---+   +   +   +   +   +   +   +   +   +   +   +   +
     |                           |                                               |
     +---+---+   +   +   +   +---+   +   +   +   +   +   +---+   +   +   +   +   +
     |       |                           |           |   |                       |
     +   +   +   +   +---+   +---+---+   +   +   +   +   +   +   +---+   +   +   +
     |   |               |           |                           |           |   |
     +   +---+   +   +   +---+   +---+   +---+---+   +---+   +   +   +   +   +   +
     |               |                                                   |   |   |
     +   +---+   +   +   +   +   +   +   +   +   +   +---+   +   +   +   +   +   +
     |           |   |       |   |   |       |       |           |       |   |   |
     +   +---+   +   +   +   +---+   +   +   +   +   +   +---+   +   +---+---+   +
     |                   |   |   |   |       |   |                               |
     +   +   +   +   +   +---+   +   +   +   +---+   +   +   +   +---+   +   +   +
     |               |                   |   |   |   |       |                   |
     +   +   +   +   +   +---+   +   +   +---+   +   +---+   +   +   +   +   +   +
     |               |       |   |   |               |                           |
     +   +   +   +   +---+   +   +   +---+   +---+   +   +   +   +---+   +   +   +
     |                                   |       |   |                           |
     +   +   +---+   +   +---+---+   +   +   +---+   +   +   +   +   +   +   +   +
     |   |                           |       |   |   |   |               |       |
     +---+---+   +   +   +   +---+   +   +---+   +   +   +   +   +   +   +---+   +
     |                               |               |       |               |   |
     +---+   +---+   +   +   +   +   +   +   +   +---+   +   +---+---+---+   +   +
     |       |   |   |   |       |   |   |                           |           |
     +   +---+   +   +   +   +   +   +   +   +   +---+   +   +   +   +   +   +   +
     |               |   |       |                           |               |   |
     +---+   +   +   +   +---+   +   +   +   +   +   +---+   +   +   +   +   +   +
     |                                   |   |                                   |
     +   +   +   +   +   +   +   +---+   +   +   +   +   +   +   +   +   +---+   +
     |       |   |                                                       |   |   |
     +   +   +---+   +   +   +   +---+   +   +   +---+---+   +   +---+   +   +   +
     |               |   |   |       |                   |                       |
     +   +   +   +   +   +   +   +   +   +---+---+   +   +---+   +---+---+   +   +
     |                           |   |                                           |
     +   +---+   +---+   +   +---+   +   +   +   +   +   +   +   +   +---+   +   +
     |                                                                           |
     +   +   +   +   +   +   +   +---+   +   +   +   +   +   +   +   +   +   +   +
     |   |       |       |   |                               |   |       |       |
     +   +   +   +---+   +   +   +---+   +   +   +   +---+   +---+   +---+   +   +
     |       |           |                                                       |
     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

LICENCE

See LICENCE.

About

dsu, maze, java, disjoint-set-union-find,

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages