Prims algorithm maze generator

dev-main 2021-12-31 12:53 UTC

This package is auto-updated.

Last update: 2024-09-29 06:14:36 UTC


README

Prims algorithm and maze generator

Installation

composer require perry-rylance/prims

Usage

First construct a Maze, specifying width, height and seed (optional).

$maze = new Maze(15, 15, 123);

Now call

$maze->generate();

Now you can access the multidimensional array of cells via

$maze->cells;

Recommendations

  • Odd dimensions work best (otherwise you may have a 2-cell border on one or more sides)
  • Please note the generated maze does not have outer walls