No description
- Python 100%
|
|
||
|---|---|---|
| doc | Add README.md | |
| src/labyrinthe | Migrate to uv | |
| tests | Migrate to uv | |
| .gitignore | Migrate to uv | |
| .python-version | Migrate to uv | |
| AGENTS.md | Migrate to uv | |
| pyproject.toml | Migrate to uv | |
| README.md | Migrate to uv | |
| uv.lock | upgrade deps | |
Labyrinthe
labyrinthe generates and visualizes labyrinths using multiple carving algorithms.
It uses pygame for rendering.
Requirements
- Python 3.11+
uvinstalled: https://docs.astral.sh/uv/
Installation
Install from source (this repository):
uv sync
This creates a project environment and installs runtime + developer dependencies.
Command Line Use
Run the interactive demo with the console command:
uv run labyrinthe
Equivalent module invocation:
uv run python -m labyrinthe
Controls:
SPACE: advance to next generated labyrinthESC: quit
Module Use
Use the package from Python:
from labyrinthe import BinaryTree, Labyrinth, Pos
lab = Labyrinth(carver=BinaryTree, width=20, height=20)
lab.carve()
start = Pos((0, 0))
print(lab[start]) # bit flags for open passages from cell (0, 0)
Available carvers:
BinaryTreeSidewinderBacktrackingDepthFirst
Development Commands
Run formatting, linting, type checks, and tests:
uv run ruff format src tests
uv run ruff check --fix src tests
uv run mypy src
uv run pytest
Demo Screenshot
Screenshot taken while the DepthFirst carver is busy.