Go to file
osmal bbe64c9ff6 Initial commit 2023-11-20 00:18:02 +01:00
src Initial commit 2023-11-20 00:18:02 +01:00
.gitignore Initial commit 2023-11-20 00:18:02 +01:00
LICENCE Initial commit 2023-11-20 00:18:02 +01:00
README.md Initial commit 2023-11-20 00:18:02 +01:00
composer.json Initial commit 2023-11-20 00:18:02 +01:00

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;">&nbsp;&nbsp;</span>' : '<span style="background-color: #fff;">&nbsp;&nbsp;</span>';
    }
    echo '<br>';
}
echo '</pre>';