Back to Maze Forge

Documentation

DELIVERABLES

Deliverables - Maze Generator & Solver

Project Overview

A terminal CLI tool that generates random mazes using multiple algorithms, renders them as ASCII art, and solves them with animated pathfinding. Pure Node.js, zero npm dependencies.

Verified Test Results (from node --test output)

shell
# tests 34
# pass 34
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 74.444435

Test Breakdown

  • CLI Tests: 7 tests (argument parsing, validation)
  • Maze Generation Tests: 8 tests (algorithms, dimensions, seeding)
  • PRNG Tests: 6 tests (random number generation)
  • Maze Rendering Tests: 5 tests (ASCII output, colors)
  • Maze Solving Tests: 8 tests (BFS, DFS, A* algorithms)

Functional Requirements Implemented

FR-1: Maze Generation ✅

  • Recursive Backtracking algorithm
  • Prim's Algorithm
  • Kruskal's Algorithm
  • Configurable dimensions (width x height)
  • Reproducible mazes with seed

FR-2: Maze Solving ✅

  • BFS (Breadth-First Search) - always finds shortest path
  • DFS (Depth-First Search) - finds valid path
  • A* algorithm - finds shortest path using heuristics
  • Solution path clearly marked with *

FR-3: Animated Output ✅

  • Terminal animation with configurable delay
  • Visited cells shown as o
  • Solution path shown as *
  • Uses terminal cursor movement

FR-4: CLI Interface ✅

Commands:
  • generate - Generate new maze
  • solve - Solve a maze
  • export - Export to file
All flags implemented as specified in spec.

FR-5: Export Functionality ✅

  • TXT export with ASCII art
  • JSON export with grid, walls, solution, metadata

FR-6: README Documentation ✅

Complete docs in docs/README.md with:
  • Quick start
  • Installation
  • All CLI commands and options
  • Examples
  • Error messages

Non-Functional Requirements

NFR-1: Performance ✅

  • Handles mazes up to 100x100 efficiently
  • All generation algorithms complete in milliseconds for typical sizes

NFR-2: Reproducibility ✅

  • Same seed produces identical mazes
  • Seeded PRNG implementation

Project Structure

shell
3-development/
├── src/
│   ├── cli.js          # CLI entry point
│   ├── generation.js   # Maze generation algorithms
│   ├── solving.js      # Maze solving algorithms
│   ├── rendering.js    # ASCII rendering
│   └── prng.js         # Seeded random number generator
├── tests/
│   ├── cli.test.js
│   ├── generation.test.js
│   ├── prng.test.js
│   ├── rendering.test.js
│   └── solving.test.js
├── docs/
│   ├── README.md
│   └── lint-output.txt
└── package.json

How to Run

bash
cd projects/018-maze-generator/3-development
node src/cli.js generate --width 20 --height 10
node src/cli.js solve --solver bfs --animate

Nice-to-Have Features

All core features implemented - no deferrals needed.

© 2026 Jonathan Leahy · v1.0.1