Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 556 Bytes

binarytree.md

File metadata and controls

20 lines (14 loc) · 556 Bytes

BinaryTree

Implementation of the BinaryTree maze algorithm from the book "Mazes for Programmers". This algorithm works by visiting each cell in the grid and choosing to carve a passage either north or south.

Examples:

import {AlgorithmType, Maze} from 'trailz';

const maze = new Maze(10, 10, AlgorithmType.BinaryTree);
console.log(maze.string);

Creates a 10x10 grid and uses the BinaryTree algorithm to carve a maze. The .string property will return an ascii representation of the maze.