To limit crawling, anonymous browsing shows current files and the last 50 commits/diffs. Clone for full history.
- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
- Add CLI evaluation for localization, resizing, and source-pixel water sweeps. - Improve acquisition of cropped low-resolution boards and detect water independently of recognized piece brightness. - Keep recognition fast with batched luminance correlation, cached dry/wet templates, and fish comparisons limited to uncertain cells. - Verification: 80 recognition, capture, tracking, and click-forwarding tests pass; 525 original/resized boards and 386,400 water variants are exact. Paired recognition timing improves from 36-41 ms to 12-18 ms. - Keep README focused on usage and link detailed solver benchmarks. Co-authored-by: OpenAI Codex <codex@noreply.forgejo.crnjak.xyz> |
||
| docs | ||
| match | ||
| optimize | ||
| tests | ||
| .gitignore | ||
| .python-version | ||
| evaluate_recognition.py | ||
| evaluate_waterline.py | ||
| LICENSE | ||
| pyproject.toml | ||
| README.md | ||
| requirements.txt | ||
| screen_scan.py | ||
| uv.lock | ||
puzpirobot
Move suggestions for the Puzzle Pirates bilging puzzle. Captures the board and shows planned swaps with numbered corner badges, in click order.
Setup
Linux with an X11 desktop, Python 3.14, uv, and a Matplotlib GUI backend are
required. On Arch Linux, install tk. Install Python dependencies with:
uv sync --locked
Supply a board header as bilging.png and single-piece templates at these paths.
Game artwork is omitted and ignored by Git; piece templates are resized to 45 × 45.
images/whiteblue_square.png
images/greenblue_diamond.png
images/lightblue_circle.png
images/lightyellow_circle.png
images/darkblue_square.png
images/lightblue_square.png
images/lightblue_diamond.png
images/puffer.png
images/crab.png
images/jellyfish.png
Run
uv run python screen_scan.py
uv run --extra input python screen_scan.py --solver gravity --depth 6 --forward-clicks
uv run python screen_scan.py --screenshot screenshot.png
Keep the board and header visible beside the preview. Scale is detected
automatically. Click the numbered pairs in order; wait while a swap settles.
With --forward-clicks, left-click each pair in the preview to send the click to
the game. This requires live capture. Close the window or press Ctrl+C to stop.
The default templates solver searches cached plans of up to six moves. Use
--solver dfs for a first-clear search or --solver gravity for lookahead through
clears. The first launch builds caches and compiles matching code.
Use --help for options including --depth, --monitor, --scale and --debug.
See solver behavior and benchmarks for scoring
assumptions, performance measurements and reproduction commands.
Evaluation dataset
uv run python screen_scan.py --dataset-dir datasets/bilging
uv run python evaluate_recognition.py datasets/bilging --export-variants --require-perfect
uv run python evaluate_waterline.py datasets/bilging --require-perfect
--dataset-dir shows a Save screenshot button. Each tap saves a fresh capture
in an ordered session: screenshot.png, normalized board.png, and predictions
in metadata.json. Evaluation requires a separately reviewed annotation.json
per frame.
Recognition evaluation checks original images and six lower resolutions. The
water sweep raises a calibrated stationary tint one source pixel at a time.
Reports and resized variants go to build/recognition-evaluation/; use each
script's --help for scales, output paths and quicker diagnostic runs.
For gravity evaluation, save before and after each swap and record the swapped pair. Keep the sequence in one session.
Tests
MPLBACKEND=Agg uv run python -m unittest discover -s tests -v