fralonra / doolhof

Genrates a maze, using Prim's algorithm.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

doolhof

Build Status npm version Greenkeeper badge

Doolhof, which stands for a labyrinth in Dutch, helps you genrates a maze, using Prim's algorithm.

Install

npm install doolhof

or

yarn add doolhof

Usage

import Doolhof from 'doolhof'

const maze = new Doolhof({
  row: 5, // The row count of the maze. Walls are excluded. Default: 10.
  col: 5, // The column count of the maze. Walls are excluded. Default: 10.
  start: [1, 0], // The coordinate of the entry. Walls are included. Default: the top-left corner.
  end: [9, 10] // The coordinate of the exit. Walls are included. Default: the bottom-right corner.
})

maze.generate() // Generates a new maze with the given option.
maze.get() // Get the formatted data of the maze.

About

Genrates a maze, using Prim's algorithm.

License:MIT License


Languages

Language:JavaScript 100.0%