1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
//! A playground for maze and procedural dungeon generation in Rust.
//!
//! `amaze` provides a collection of algorithms and utilities for creating,
//! solving, rendering, and serializing mazes and procedural dungeons.
//! It is the core library behind the `amaze-cli` and `amaze-gui` binaries,
//! suitable for games, simulations, and procedural-content experiments.
//!
//! # Features
//!
//! - **Perfect-maze generators** for 4-connected grids: recursive backtracker,
//! growing tree, Kruskal, Eller, Wilson, hunt-and-kill, sidewinder,
//! binary tree, and Prim.
//! - **Hexagonal (6-connected) generators**: recursive backtracker,
//! growing tree, and Aldous-Broder.
//! - **Procedural dungeons**: caverns, rooms, and winding layouts.
//! - **Pathfinding solvers**: BFS, DFS, A\*, and dead-end filling,
//! all implementing the shared [`preamble::MazeSolver`] trait.
//! - **Renderers**: Unicode box-drawing characters and PGM images,
//! plus statistics via [`preamble::MazeStats`].
//! - **Graph representations**: adjacency lists, edge lists, passability
//! grids (with hex variants), and optional `petgraph` integration.
//! - **Serialization**: binary format, JSON, and file I/O support.
//!
//! # Quick Start
//!
//! Generate a small rectangular maze and render it with Unicode box-drawing
//! characters:
//!
//! ```
//! use amaze::generators::RecursiveBacktracker4;
//! use amaze::preamble::Wall4Grid;
//! use amaze::renderers::{UnicodeRenderStyle, UnicodeRenderer};
//!
//! let generator = RecursiveBacktracker4::new_from_seed(0xdeadbeef);
//! let grid: Wall4Grid = generator.generate(6, 6);
//!
//! let renderer = UnicodeRenderer::new(UnicodeRenderStyle::Heavy, true);
//! let output = renderer.render(&grid);
//! assert!(!output.is_empty());
//! ```
//!
//! # Feature Flags
//!
//! The crate ships with a rich set of optional features. The defaults are
//! `renderers`, `generators`, `solvers`, and `representations`.
//!
//! | Feature | Description |
//! |---------|-------------|
//! | `generators` | All 4-connected grid maze generation algorithms |
//! | `generators-hex` | All hexagonal (6-connected) maze generation algorithms |
//! | `solvers` | All maze solving algorithms (BFS, DFS, A\*, dead-end filling) |
//! | `renderers` | All rendering backends (Unicode + PGM) |
//! | `representations` | Standard 4-connected graph representations |
//! | `hex-representations` | Hexagonal maze representations |
//! | `dungeon-representations` | Dungeon/cave representations |
//! | `binary-format` | Binary serialization format |
//! | `json-format` | JSON serialization format |
//! | `file-io` | File I/O combining binary and JSON formats |
//! | `petgraph` | `petgraph` integration for graph operations |
//! | `serde` | Serde serialization support |
//!
//! Fine-grained sub-flags (e.g. `generator-kruskal`, `solver-bfs`) are
//! documented in `Cargo.toml` and on docs.rs.
//!
//! # Crate Layout
//!
//! The [`preamble`] module re-exports the most commonly used types.
//! Key modules: [`generators`], [`solvers`], [`renderers`],
//! [`dungeon`], [`representations`], and `storage` (with `file-io`).
//!
//! # Companion Crates
//!
//! - `amaze-cli` — command-line interface for generating and rendering mazes.
//! - `amaze-gui` — graphical user interface with live preview.
//!
//! # License
//!
//! Licensed under EUPL-1.2 OR MIT OR Apache-2.0.