Terminal-based maze generation & solving game
Navigate through algorithmically generated mazes with style ๐ฏ
๐ฎ Interactive Gameplay โข Navigate with WASD or arrow keys
๐ง Multiple Algorithms โข Recursive Backtracking, Kruskal's MST, Prim's MST
๐จ Beautiful Rendering โข Unicode art with emoji characters
โก Lightning Fast โข Written in Haskell for optimal performance
๐ฆ Zero Dependencies โข Single static binary, ready to run
๐ Cross Platform โข macOS (Intel & Apple Silicon) and Linux support
curl -fsSL https://raw.githubusercontent.com/k1-c/meiro/main/install.sh | bashOr with custom install directory:
curl -fsSL https://raw.githubusercontent.com/k1-c/meiro/main/install.sh | MEIRO_INSTALL_DIR=~/.local/bin bash# Basic usage - start game with default settings
meiro
# Specify maze size (width x height) - both must be odd numbers >= 5
meiro --size 15x15
meiro -s 25x35
# Choose algorithm
meiro --algorithm recursive # Recursive Backtracking (default)
meiro --algorithm kruskal # Kruskal's MST
meiro --algorithm prim # Prim's MST
meiro -a kruskal # Short form
# Combine options
meiro --size 41x31 --algorithm prim
# Help & version
meiro --help # Show help message
meiro --version # Show version infoAvailable Options:
| Option | Short | Description | Default |
|---|---|---|---|
--size WxH |
-s |
Maze dimensions (width x height, both must be odd numbers โฅ 5) | 25x15 |
--algorithm |
-a |
Generation algorithm (recursive, kruskal, prim) |
recursive |
--help |
-h |
Show help message | - |
--version |
-v |
Show version information | - |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโ๐ โโ โโ โโ
โโโโโโ โโ โโ โโ โโโโโโ โโ
โโ โโ โโ โโ โโ
โโ โโโโโโโโโโโโโโ โโ โโโโโโ
โโ โโ โโ โโ
โโ โโโโโโ โโโโโโโโโโโโโโ โโ
โโ โโ โโ โโ
โโโโโโโโโโโโโโโโโโ โโ โโ โโ
โโ โโ โโ โโ โโ
โโ โโโโโโ โโ โโโโโโโโโโ โโ
โโ โโ โโ โโ
โโ โโโโโโโโโโโโโโ โโโโโโโโโโ
โโ ๐คโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Controls:
WASDorArrow Keysโข Move aroundQโข Quit game
๐ฟ Recursive Backtracking (Default)
- Type: Depth-First Search
- Characteristics: Creates long winding passages with high "river" factor
- Performance: O(n) time, O(n) space
- Best for: Classic maze feel with challenging paths
๐ Kruskal's Algorithm
- Type: Minimum Spanning Tree
- Characteristics: Creates more open areas with shorter dead ends
- Performance: O(n log n) time, O(n) space
- Best for: Balanced difficulty with multiple solution paths
๐ฏ Prim's Algorithm
- Type: Minimum Spanning Tree (growing tree)
- Characteristics: Creates dense branching with organic growth patterns
- Performance: O(n log n) time, O(n) space
- Best for: Compact mazes with natural-looking structures
Built with modern Haskell practices:
src/
โโโ Meiro/
โ โโโ Types.hs # Core data types
โ โโโ Utils.hs # Utility functions
โ โโโ Rendering.hs # Terminal rendering
โ โโโ Gameplay.hs # Game logic & input
โ โโโ Algorithms/
โ โโโ RecursiveBacktrack.hs
โ โโโ Kruskal.hs # Union-Find implementation
โ โโโ Prim.hs # Set-based algorithm
Tech Stack:
- Language: Haskell with GHC 9.10
- Build System: Stack
- Dependencies: Minimal (only base libraries)
- Testing: Hspec + QuickCheck
- CI/CD: GitHub Actions
- Stack
- GHC 9.10.2
git clone https://github.com/k1-c/meiro.git
cd meiro
# Development build
stack build
# Run tests
stack test
# Build optimized binary
stack build --copy-bins --local-bin-path ./distWe welcome contributions! Please see CONTRIBUTING.md for guidelines.
| Metric | Value |
|---|---|
| Binary Size | ~4MB |
| Memory Usage | <10MB |
| Startup Time | <100ms |
| 50x50 Maze | <1ms generation |
Meiro supports custom rendering styles through the CellStyle configuration:
customStyle = CellStyle
{ wallChar = "โโ"
, pathChar = " "
, startChar = "๐ "
, goalChar = "๐"
, playerChar = "๐ค"
}Supported Platforms:
- macOS 10.15+ (Intel & Apple Silicon)
- Linux x86_64 (Ubuntu 18.04+, etc.)
Requirements:
- Terminal with Unicode support
- 4MB free disk space
- 10MB RAM
This project is licensed under the MIT License - see the LICENSE file for details.
Made with โค๏ธ in Haskell
Report Bug โข Request Feature โข Contribute
