Skip to content


This project provides set of utilities to generate, render, and other kind of stuff with mazes. Following are some mazes generated:


As mentioned early, these are just some set of utilizes which means that they can be hacked to do anything you like. The typical flow of generating a maze looks something as following:


First, you need to install the mazes101 package using npm, yarn or alternatively you can also load umd modules from CDN:

npm i mazes101 --save
yarn add mazes101
    DON'T FORGET to replace x.x.x we appropriate version
    Check all the release here:
<script src=""></script>
// here mazes101 is available in global scope

Then, the package can be used to generate the mazes as following:

import * as Rectangular from 'mazes101/boards/rectangular';
import {generate} from 'mazes101/generators/backtrack';
import {render} from 'mazes101/renderers/rectangularSvg';

let board = Rectangular.newBoard({height: 20, width: 20});
board = generate(board, Rectangular);
const svgString = render(board);


The generate method returns a new board instead of altering the provided board so, it is important to assign that board somewhere. This is true for all the functions in Mazes101, they don't have side effects instead they return the changed value.


The deno package is not yet published to but you can use import_map.json file to map mazes101 package name to github.

import mazes101 from 'mazes101';
    "imports": {
        "mazes101/": ""

To run the script use:

deno run --import-map=import_map.json index.ts


The project is still under development and therefore contributions are welcomed here is the Status of the project:

  • Boards
    • Rectangular Board
    • Weave Board
    • Circular Board
    • Trinagular Board
    • Hexagonal Board
  • Generators
    • Aldous Broder
    • Backtrack
    • Eller
    • Kruskal
    • Prim
    • Sidewinder
    • Wilson
  • Renderers
    • SVG
    • Canvas

I'm also thinking to port the code base to other languages, current Python & Dart are in my wishlist so any contributions on porting are also welcomed.