1
0
Fork
You've already forked labyrinths
0
No description
  • Python 100%
Kristian Koehntopp 85c9a5a7e9 upgrade deps
2026年03月31日 08:26:20 +02:00
doc Add README.md 2022年12月11日 08:47:49 +01:00
src/labyrinthe Migrate to uv 2026年02月10日 21:39:56 +01:00
tests Migrate to uv 2026年02月10日 21:39:56 +01:00
.gitignore Migrate to uv 2026年02月10日 21:39:56 +01:00
.python-version Migrate to uv 2026年02月10日 21:39:56 +01:00
AGENTS.md Migrate to uv 2026年02月10日 21:39:56 +01:00
pyproject.toml Migrate to uv 2026年02月10日 21:39:56 +01:00
README.md Migrate to uv 2026年02月10日 21:39:56 +01:00
uv.lock upgrade deps 2026年03月31日 08:26:20 +02:00

Labyrinthe

labyrinthe generates and visualizes labyrinths using multiple carving algorithms. It uses pygame for rendering.

Requirements

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 labyrinth
  • ESC: 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:

  • BinaryTree
  • Sidewinder
  • Backtracking
  • DepthFirst

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.