README-work
Raku Graph::RandomMaze
Raku package for random maze making using graphs.
The package provides the function random-maze the implementation of which is explained in [AA1].
Remark: Since the package "Graph", [AAp1], is used for the implementation the package name is "Graph::RandomMaze".
Usage
Rectangular maze
use Graph::RandomMaze;
my %rect = random-maze(rows => 8, columns => 16, type => 'rectangular', properties => Whatever);my %opts = engine => 'neato', :8size, vertex-shape => 'point', edge-thickness => 12;
%rect<walls>.dot(|%opts):svg;image izef_graph_randommaze_dist_docs_rectangular_maze_svg not found
Hexagonal maze
my %hex = random-maze(rows => 8, columns => 16, type => 'hexagonal', properties => Whatever);%opts<edge-thickness> = 32;
%hex<walls>.dot(|%opts):svg;image izef_graph_randommaze_dist_docs_hexagonal_maze_svg not found
The returned hash contains:
Carved wall graph (
walls),Spanning tree used for carving (
paths),Shortest-path solution (
solution),Bookkeeping keys (
shape,dimensions,start,end)
CLI
The package provides the Command Line Interface (CLI) script random-maze for making random mazes
and exporting them in different formats. Here is the usage message:
random-maze --helpReferences
[AA1] Anton Antonov, "Day 24 ā Maze Making Using Graphs", (2025), Raku Advent Calendar at WordPress.
[AAp1] Anton Antonov, Graph, Raku package, (2024-2025), GitHub/antononcube.