๐ง puzzle_engine
A modular Rust engine for building and solving puzzles โ starting with grid-based mazes and ready to grow ๐งฉ
โจ Overview
puzzle_engine
is a general-purpose puzzle library written in Rust. It's designed with extensibility and clarity in mind โ ideal for games, educational tools, or AI challenges.
This crate currently includes support for grid mazes, a type of perfect maze generated using randomized DFS. More puzzle types (Sudoku, Nonograms, Word Puzzles, etc.) are coming soon!
๐ Features
โ
Procedural maze generation using randomized DFS
โ
Minimal API to move through and solve mazes
โ
Fully connected (perfect) mazes โ no isolated areas
โ
Lightweight and dependency-free (except rand
)
โ
Built-in test coverage and examples
โ
Easy to extend with other puzzles in the future
๐งฉ Example: Grid Maze
use ;
๐ฆ Installation
Add the following to your Cargo.toml
:
[]
= "0.1"
๐ Modules
๐งฑ grid_maze
A classic maze represented as a 2D grid. Each cell connects to neighbors via randomized depth-first search.
Maze::new(width, height)
โ Create a mazemaze.try_move(Direction)
โ Move the player if there's a pathmaze.is_at_end()
โ Check if the player has reached the goal
๐งช Tests
Run tests with:
Includes checks for:
- Valid movement and boundary logic
- Maze completeness
- Player reaching the end
๐ฎ Roadmap
Planned puzzle modules:
- Grid Maze (DFS-based)
- Sudoku (validator + solver)
- Nonograms
- Word search / Crossword generator
- Sokoban-style logic puzzles
- Puzzle trait abstraction for polymorphic puzzle engines
๐ค Contributing
Contributions are welcome! Feel free to open issues or PRs for new puzzle types, algorithm improvements, tests, or docs.
๐ License
Licensed under either of:
- Apache License, Version 2.0
- MIT License
See LICENSE for details.
๐ Links
Built with ๐งฉ and ๐ by Your Name