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 --help

References

[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.

Graph::RandomMaze v0.0.1

Random maze generator on rectangular and hexagonal graphs using Graph.

Authors

    License

    Artistic-2.0

    Dependencies

    Graph:ver<0.0.33+>:auth<zef:antononcube>Math::Nearest:ver<0.0.6>:auth<zef:antononcube>Data::Generators:ver<0.1.11+>:auth<zef:antononcube>

    Test Dependencies

    Provides

    • Graph::RandomMaze

    The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.