npm

Need private packages and team management tools?Check out npm Orgs. »

@ludw1gj/maze-generation

0.7.0 • Public • Published

Maze Generation

Recursive Backtracking

  1. Make the initial cell the current cell and mark it as visited.
  2. While there are unvisited cells:
    1. If the current cell has any neighbours which have not been visited
      1. Choose randomly one of the unvisited neighbours
      2. Push the current cell to the stack
      3. Remove the wall between the current cell and the chosen cell
      4. Make the chosen cell the current cell and mark it as visited
    2. Else if stack is not empty
      1. Pop a cell from the stack
      2. Make it the current cell

install

npm i @ludw1gj/maze-generation

Downloadsweekly downloads

2

version

0.7.0

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability