cartesian_maze_puzzle 0.1.0

A cartesian maze puzzle for you to solve.
Documentation
# ๐Ÿงญ cartesian-maze-puzzle


[![Crates.io](https://img.shields.io/crates/v/cartesian-maze-puzzle.svg)](https://crates.io/crates/cartesian-maze-puzzle)
[![Docs.rs](https://docs.rs/cartesian-maze-puzzle/badge.svg)](https://docs.rs/cartesian-maze-puzzle)

A minimal, efficient, and fun procedural maze generation library written in Rust ๐Ÿฆ€. Generate perfect mazes (no loops, no isolated sections), navigate them programmatically, and use them for puzzles, games, AI pathfinding, or teaching algorithms.

---

## ๐Ÿš€ Features


- Generates perfect mazes using randomized depth-first search (DFS)
- Easy-to-use API to move through the maze
- Fully deterministic size and layout
- Lightweight with zero external dependencies beyond `rand`
- Built-in unit tests
- Suitable for CLI, GUI, or game integration

---

## ๐Ÿ“ฆ Installation


Add the following to your `Cargo.toml`:

```toml
[dependencies]
cartesian-maze-puzzle = "0.1"
```

---

## ๐Ÿงฑ Example


```rust
use cartesian_maze_puzzle::{Maze, Direction};

fn main() {
    let mut maze = Maze::new(5, 5);

    println!("Starting at: {:?}", maze.player);
    
    // Try moving east
    if maze.try_move(Direction::East) {
        println!("Moved to: {:?}", maze.player);
    } else {
        println!("Hit a wall!");
    }

    // Check if you've reached the end
    if maze.is_at_end() {
        println!("You solved the maze!");
    }
}
```

---

## ๐Ÿงช Tests


Run unit tests with:

```bash
cargo test
```

Tests verify:

- Valid movement and boundary constraints
- All cells are reachable
- Player position is correctly updated
- Maze is fully connected (i.e., perfect maze)

---

## ๐Ÿ“š Documentation


The full API is available on [docs.rs](https://docs.rs/cartesian-maze-puzzle).

---

## ๐Ÿค” Why "Cartesian"?


Because the maze operates on a classic Cartesian coordinate grid where `(0, 0)` is the top-left corner. It's simple, intuitive, and easy to visualize or integrate into grid-based games.

---

## ๐Ÿ“‚ Folder Structure Suggestion


```
src/
โ”œโ”€โ”€ lib.rs          # Maze logic
โ”œโ”€โ”€ main.rs         # (Optional) CLI or demo interface
tests/
โ”œโ”€โ”€ integration.rs  # Integration tests
```

---

## ๐Ÿ“œ License


Licensed under either of:

- Apache License, Version 2.0
- MIT license

See [LICENSE](LICENSE) for more information.

---

## โœจ Contribution


Contributions welcome! Feel free to open issues or PRs for:

- Bug fixes
- Maze solving/pathfinding algorithms
- CLI game implementation
- Visualization features (ASCII or graphics)

---

## โค๏ธ Acknowledgments


Thanks to the Rust community and all contributors to the `rand` crate!

---

Made with ๐Ÿงฉ by [Andrew Sims](https://github.com/andrewsimsd)