Skip to content
Patrizio Amella edited this page Mar 26, 2021 · 14 revisions

Table of contents

Usage

Command Line Interface

To use the CLI you first need to download the latest release and to have on your computer the .Net Core 5 runtime.

The CLI is designed to be composable with a maximum of options on each step to create unique and beautiful mazes.

The basic idea is to pipe different actions to generate and visualize, in the end, a maze.

The actions are :

  1. Choosing a canvas
  2. Choosing a type of grid
  3. Choosing a maze generator algorithm
  4. Choosing a render
  5. Choosing an output

For example, the following line will generate a text maze in a file :

.\Mazes.exe s-rectangle -r 6 -c 10 : g-ortho : a-hk -s 1 : rt-ortho -e : o-file -p "./test.txt"

Each part is separated by a ':' wich is used as the pipe symbol.

Let's break it down :

Actions Description
.\Mazes.exe the path to the CLI itself
s-rectangle -r 6 -c 10 a rectangle shape with 6 rows and 10 columns
g-ortho an orthogonal grid type
a-hk -s 1 use the "Hunt and Kill" algorithm with a random seed of 1 to generare the maze
rt-ortho -e the text unicode render with an entrace and an exit
o-file -p "./test.txt" save on the disk into the specified file

The result might look like this :

 ━┯━━━━━┯━━━━━┯━━━━━┓
┳ ┴ ╭─╴ │ ┬ ╶─╯ ┬ ┬ ┃
┠───╯ ╶─┴─┴─┬─╴ │ │ ┃
┃ ╶─╮ ╭───╴ ┴ ╭─┴─╯ ┃
┠───┤ │ ╭───┬─┴─┬─╴ ┃
┃ ┬ ┴ │ ┴ ┬ ╰─╴ │ ╶─┚
┗━┷━━━┷━━━┷━━━━━┷━━━ 

There are a number of actions available for each step. Note that not every combination will yield a valid maze.

It is possible to get every option for a given action by using --help so for example s-rectangle --help

Website

A website in preview version is available here where you can generate random mazes.


Build

To build the project from the source code, you'll need the latest dotnet SDK available here https://dotnet.microsoft.com/download/dotnet/5.0

After you've cloned the project from Github, navigate to the root folder (where the "f-a-maze-ing.sln" file is) and run the command dotnet build. It should restore all dependencies and compile everything.

Clone this wiki locally