Python engine · Guaranteed-solvable deduction
A procedural detective game with a real deductive core. The engine generates a mystery from a seed — suspects, a hidden culprit, and clues — and proves the clues uniquely identify the culprit before handing you the case. Pure Python; the LLM is optional flavour. Play a real generated case below.
Play a real case
These cases were generated by the Python engine (python demo.py 7) and committed verbatim — suspects, clues and the exact per-clue elimination sets. The buttons below run the same constraint logic the Python solver uses: a suspect survives only if every clue implicates them. Interrogate to see who each clue clears, then accuse.
This page is static (GitHub Pages) and runs no LLM — it replays committed, engine-generated cases. The real generator, constraint solver and uniqueness guarantee live in the Python package in this repo; the optional LLM hook only restyles text and never touches the deduction.
The engine
Suspects share overlapping attributes so no single clue gives anyone away.
Clues are drawn from the culprit's own attributes, so a true clue never clears the culprit.
Keep a suspect only if every clue implicates them; the survivors are the answer.
The generator runs the solver and only keeps a case when exactly one survivor remains — the culprit.
True facts phrased to match everyone — flavour that can never break uniqueness.
If a key is set, an LLM restyles the prose. It never decides clues or the verdict.
Why it's real
Run it yourself: pip install -r requirements.txt then python -m pytest -q (855 passing) and python demo.py.