perry-rylance / prims
Prims algorithm maze generator
dev-main
2021-12-31 12:53 UTC
Requires
- php: >=7.4
- savvot/random: ^0.3.0
Requires (Dev)
This package is auto-updated.
Last update: 2024-10-29 06:25:23 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