Skip to content

tdons/uhmazeing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uhmazeing

An amazing program that generates mazes.

Building

$ make

Example usage

$ # Use 0 as a fixed seed for the prng (default is a random seed).
$ ./mz --seed 0
┌─────────────────┬─────┬───┬─────────┐
│ ┌─┬─────┬─────╴ ├───╴ │ ╷ ╵ ┌─┐ ┌─╴ │
│ ╵ │ ┌─┐ ╵ ┌─────┘ ╶───┘ ├───┘ │ │ ╶─┤
│ ┌─┘ │ └───┤ ╶─────┬─────┘ ╶───┤ ├─╴ │
│ │ ┌─┘ ╷ ┌─┴─────┐ │ ┌─────┬─╴ │ └─┐ │
│ │ └─┐ │ │ ╷ ┌───┘ │ └───┐ │ ╶─┼─╴ │ │
│ └─┐ │ └─┘ │ ╵ ╶───┼───╴ ╵ ├─╴ │ ╶─┴─┤
├─┐ │ └─┐ ┌─┴─┬───┐ └───────┘ ╷ └───┐ │
│ │ ├─┐ │ │ ╷ ╵ ╷ │ ┌─────┬─╴ ├─────┤ │
│ ╵ ╵ └─┴─┘ ├───┘ └─┘ ┌─╴ └───┘ ┌─╴ ╵ │
└───────────┴─────────┴─────────┴─────┘
$ # Solve the outputted maze
$ ./mz --with-path --seed deadbeef --width 10 --height 25
┌───────────────────────────┬───────────┐
│ o ──────────────────────┐ │           │
│   ╷   ┌───────┬───────┐ │ │   ╶───┐   │
│   │   │       │ ┌───┐ │ │ │       │   │
├───┘   ├───╴   │ │ ╷ │ │ │ └───────┘   │
│       │       │ │ │ │ │ └───────────┐ │
│   ╶───┤   ┌───┘ │ │ │ └───────────┐ │ │
│       │   │ ┌───┘ │ │             │ │ │
├───╴   │   │ │ ╶───┤ │ ╶───────────┘ │ │
│       │   │ └───┐ │ └───────────────┘ │
│   ╶───┤   └───┐ │ ├───────────────┬───┤
│       │       │ │ │         ┌───┐ │   │
├───╴   │   ╷   │ │ └───────┐ │ ╷ │ ╵   │
│       │   │   │ └───────┐ │ │ │ └───┐ │
│   ┌───┘   └───┴───────┐ │ │ │ └───┐ │ │
│   │     ┌───────────┐ │ │ │ └───┐ │ │ │
│   └───┐ │ ╶───┬───╴ │ │ │ └───╴ │ │ │ │
│       │ └───┐ │ ┌───┘ │ └───────┘ │ │ │
│   ╷   └───┐ │ │ │ ╶───┼───────────┤ │ │
│   │       │ │ │ └───┐ │ ┌───────┐ │ │ │
├───┴───╴   │ │ └───┐ │ │ │ ┌───┐ │ ╵ │ │
│           │ └───┐ │ │ │ │ │   │ └───┘ │
│   ┌───────┴───┐ │ │ │ │ │ │   └───────┤
│   │           │ │ │ │ │ │ │           │
│   │   ╶───────┤ │ │ │ ╵ │ ├───────╴   │
│   │           │ │ │ └───┘ │           │
│   └───┬───╴   │ │ └───┬───┘   ╶───────┤
│       │       │ └───┐ │               │
│   ╷   │   ┌───┴───┐ │ └───────┐   ╷   │
│   │   │   │       │ └───────┐ │   │   │
├───┘   │   ╵   ╷   └───────┐ │ ├───┘   │
│       │       │           │ │ │ ┌───┐ │
│   ┌───┘   ╶───┴───┐   ╷   │ │ ╵ │ ╷ │ │
│   │               │   │   │ └───┘ │ │ │
├───┘   ┌───┬───────┤   ├───┴───────┘ │ │
│       │   │       │   │ ┌───────────┘ │
│   ╶───┤   │   ╷   ╵   │ │ ╶───┬───────┤
│       │   │   │       │ └───┐ │ ┌───┐ │
├───╴   ╵   │   ├───────┴───┐ │ ╵ │ ╷ │ │
│           │   │ ┌───────┐ │ └───┘ │ │ │
│   ┌───────┘   │ │ ┌───┐ │ └───────┘ │ │
│   │           │ │ │   │ └───────────┘ │
│   │   ╶───────┤ │ ╵   ├───────────┬───┤
│   │           │ └───┐ │ ┌───────┐ │   │
│   ├───────╴   └───┐ │ │ │ ┌───╴ │ │   │
│   │               │ │ │ │ │     │ │   │
├───┘   ╷   ┌───────┤ │ │ │ └───┐ │ │   │
│       │   │       │ │ │ └───┐ │ │ │   │
│   ╶───┴───┘   ╷   ╵ │ └───╴ │ │ │ ╵   │
│               │     └───────┘ │ └── o │
└───────────────┴───────────────┴───────┘
$ # Generate a large maze (25,000,000 cells) but don't print it to see how the generation methods perform
$ time ./mz -d5000 -gdfs -onull
real	0m1.578s
$ time ./mz -d5000 -gkruskal -onull
real	0m7.858s

Options

-g specify method used to --generate the maze, either "dfs" (default) or "kruskal"

-d specify both --dimensions, the width and height of the maze (in cells)

-w specify --width (in cells)

-h specify --height (in cells)

-o method used to print the maze to standard --output, either "compact" (default), "simple", "null", or "pretty".

-p solve the maze and output the solution --with-path, changes the default output method to "pretty"

-s specify the --seed for the prng, defaults to a random seed

-v print --verbose output to standard error

-V print the --version of the program

About

An amazing program that generates mazes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages