|
| 1 | +# :door: amaze :door: |
| 2 | + |
| 3 | +A program to create, solve and draw mazes in your terminal or in 2D/3D |
| 4 | + |
| 5 | +## Gallery |
| 6 | + |
| 7 | +2D Terminal view |
| 8 | + |
| 9 | +<p align="center"> |
| 10 | + <img style="float: right;" src="https://github.com/fred1268/amaze/blob/development/readme/terminal_15x15_recursivebacktracker_solved.png" alt="Amaze in Action"/> |
| 11 | +</p> |
| 12 | +2D Graphical view |
| 13 | +<p align="center"> |
| 14 | + <img style="float: right;" src="https://github.com/fred1268/amaze/blob/development/readme/2D_20x20_sidewinder_solved.png" alt="Amaze in Action"/> |
| 15 | +</p> |
| 16 | +3D Graphical view |
| 17 | +<p align="center"> |
| 18 | + <img style="float: right;" src="https://github.com/fred1268/amaze/blob/development/readme/3D_50x50_growingtree_solved2.png" alt="Amaze in Action"/> |
| 19 | +</p> |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## Setup |
| 24 | + |
| 25 | +This program uses G3n, so it has [the same prerequisites](https://github.com/g3n/engine#dependencies). |
| 26 | +It is pretty straightforward, since most of the computers nowadays, have an OpenGL driver and a C |
| 27 | +compiler. I tested both on Linux (manjaro) and mac M1. |
| 28 | + |
| 29 | +> Also, note that Amaze uses [**clap :clap:, the Command Line Argument Parser**](https://github.com/fred1268/go-clap). |
| 30 | +> clap is a non intrusive, lightweight command line parsing library you may want to try out in your |
| 31 | +> own projects. Feel free to give it a try! |
| 32 | +
|
| 33 | +--- |
| 34 | + |
| 35 | +## Installation |
| 36 | + |
| 37 | +``` |
| 38 | +git clone github.com/fred1268/amaze |
| 39 | +cd amaze |
| 40 | +go install |
| 41 | +``` |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +## Running the program |
| 46 | + |
| 47 | +You can run the program with several flags, although it has decent defaults. Here are the available flags: |
| 48 | + |
| 49 | +``` |
| 50 | +amaze: creates, solves and displays mazes |
| 51 | + --width, -w <width>: set maze's width |
| 52 | + --length, -l <length>: set maze's length |
| 53 | + --algo, -a <name>: choose the algorithm used to create the maze: |
| 54 | + binarytree |
| 55 | + sidewinder |
| 56 | + aldousbroder |
| 57 | + wilson |
| 58 | + huntandkill |
| 59 | + recursivebacktracker |
| 60 | + growingtree |
| 61 | + use --choice, -c to chose sub algorithm: |
| 62 | + random, last, or mix |
| 63 | + --seed, -d <seed>: use seed to generate identical maze |
| 64 | + --braid, -b <percent>: braid to remove deadends |
| 65 | + --solve, -s: solve the maze |
| 66 | + --print, -p: print maze in the terminal |
| 67 | +``` |
| 68 | + |
| 69 | +Description of the command line parameters |
| 70 | + |
| 71 | +- width and length allow you to chose the size of your map (defaults to 20). |
| 72 | + |
| 73 | +- Amaze uses various algorithms to generate mazes, so you can chose the one you prefer (defaults to binarytree). |
| 74 | + |
| 75 | +> Please note that **Growing Tree** requires the choice of a sub-algorithm. |
| 76 | +> You can chose between `random`, `last` and `mix` (defaults to `random`) |
| 77 | +
|
| 78 | +- seed allows you to replay a maze you liked in the past. The current maze's seed is displayed in the console |
| 79 | + when the program starts. |
| 80 | + |
| 81 | +- braid allows you to remove none (0%), some (1-99%) or all (100%) of the deadends in the maze |
| 82 | + (defaults to 0, keep deadends). Do **not** include the % sign like in `--braid 50`. |
| 83 | + |
| 84 | +- solve allows you to solve the maze, and will display the maze with a color gradient. |
| 85 | + The entrance (red dot) will be in lighter colors whereas the exit (green dot) will be in darker colors. |
| 86 | + By default, mazes are unresolved, just in case you want to solve them :wink:. |
| 87 | + |
| 88 | +> Please note: in the terminal, only the exit path is highlighted in a gradient of color. |
| 89 | +
|
| 90 | +- print allows you to display the maze in the terminal only (no 3D). |
| 91 | + |
| 92 | +## Feedback |
| 93 | + |
| 94 | +Feel free to send feedback, star, etc. |
0 commit comments