JSPM

maze

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q30705F
  • License MIT

Flexible perfect maze generator

Package Exports

  • maze

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (maze) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

maze

Flexible perfect maze generator

This module generates "perfect mazes" (i.e. no loops) by connecting "nodes" from a given list.

Isometric maze

Note that a "node" does not necessarily have to be a regular grid cell - it can be of any shape or size!

install

npm install maze

usage

See test.js for an extensive example. You could also clone this repository and run the script locally if you'd like to run the maze generator on your machine.

maze = generate(nodes, adjacent, choose)

Maps each node in nodes to a list of connections and stores the resulting Map in maze.

  • nodes: A list of nodes to connect
  • adjacent: A function of the form adjacent(a, b) which determines if node a and node b can be connected
  • choose: A function of the form choose(array) which chooses a random item from array

license

MIT © Brandon Semilla