osmal bbe64c9ff6 | ||
---|---|---|
src | ||
.gitignore | ||
LICENCE | ||
README.md | ||
composer.json |
README.md
PHP Maze Generator
A simple and minimalistic maze generator
Installation
composer require Osmal/Maze
Usage
Basic Usage:
require __DIR__ . '/vendor/autoload.php';
$width = 15;
$height = 15;
$maze = new Osmal\Maze\Generator($width,$height);
$maze->print();
You can also make your own display logic:
echo '<pre>';
foreach ($maze->getMaze() as $row) {
foreach ($row as $cell) {
echo $cell ? '<span style="background-color: #000;"> </span>' : '<span style="background-color: #fff;"> </span>';
}
echo '<br>';
}
echo '</pre>';