1
Getting Started
Tirsvad edited this page 2026-11-15 09:24:56 +01:00

Getting Started

🌐 English · Dansk · Bahasa Melayu

Requirements

Python 3.13 or newer. The project has no runtime dependencies; pytest, ruff and mypy are installed as development dependencies.

Install

Create a virtual environment and install the project in editable mode (Windows PowerShell first, then Linux and macOS):

python -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"

Run in Reeborg's world

Open the maze in Reeborg's world, choose Python mode, paste the contents of src/reeborg_maze/presentation/reeborg_script.py into the editor and press run.

Run offline

The offline run reads a world file and prints the final world and the result. With --animate the robot moves in the terminal; with --start X Y HEADING you choose the start (heading 0 is east, 1 north, 2 west, 3 south):

python -m reeborg_maze tests/worlds/problem_world.json
python -m reeborg_maze tests/worlds/problem_world.json --animate
python -m reeborg_maze tests/worlds/problem_world.json --animate --delay 0.05 --start 1 1 0

Run the tests

python -m pytest -v

Every free cell of the three test worlds is tried with all four headings, for both the tested function and the pasteable script.