jawira / nice-maze-generator
Create a maze using ascii art
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Forks: 0
pkg:composer/jawira/nice-maze-generator
Requires
- php: >=8.0
Requires (Dev)
- ext-mbstring: *
- phpunit/phpunit: ^9.4
This package is not auto-updated.
Last update: 2025-10-06 21:36:17 UTC
README
Create a maze using ascii art.
Usage
Use maze()
function to create an array containing the maze.
<?php
// demo.php
require __DIR__ . '/vendor/autoload.php';
use function Jawira\NiceMazeGenerator\maze;
use function Jawira\NiceMazeGenerator\maze_to_string;
$arrayMaze = maze(5, 20); // 5 rows, 20 columns
$stringMaze = maze_to_string($arrayMaze);
echo $stringMaze;
This is the output from previous code:
╭─────────────┬───────┬───┬───┬───────┬─╮
│ │ │ │ │ │ │
│ ╭─────┬─╴ ╷ ├─╴ ╭─╴ │ ╷ │ ╷ │ ╶─╮ ╷ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ ╭───╯ ╭─╯ │ ╭─┴─╮ ╵ │ ╵ │ ╰─╮ │ ╰─╯ │
│ │ │ │ │ │ │ │ │ │ │ │
│ ╵ │ ╶───┴─╮ ╵ │ ╷ ├───┴───┴─┬─╯ ├───┬─┤
│ │ │ │ │ │ │ │ │ │
├─╴ ╰─────╮ ╰───╯ │ ╵ ╶─────╮ ╵ ╶─╯ ╷ ╵ │
│ │ │ │ │ │
╰─────────┴───────┴─────────┴───────┴───╯
How to install
$ composer require jawira/nice-maze-generator
Contributing
- If you liked this project, ⭐ star it on GitLab.
- Issues are welcomed.
License
This library is licensed under the MIT license.