Solve Murdle like puzzles.
Install program
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
Create config file (see below).
Run config file
python3 -m murdle_solver config.toml
A config file contains two main sections groups and rules.
Example
groups = [["a", "b"], ["c", "d"]]
rules = ['( not ("a" "*"))', '("*" "d")']This section represents items that can be parts of a solution.
The following config:
groups = [["a", "b"], ["c", "d"], ["e", "f"]]will produce solutions
["a", "c", "e"]
["a", "c", "f"]
["a", "d", "e"]
["a", "d", "f"]
["b", "c", "e"]
["b", "c", "f"]
["b", "d", "e"]
["b", "d", "f"]
Rules filter down the generated solutions to "correct" solutions. Supported rule operations are fact, not, and, or, and xor. These need to be translated from the hints given in a puzzle.
The following examples use the following groups.
groups = [
["person1", "person2", "person3"],
["weapon1", "weapon2", "weapon3"],
["place1", "place2", "place3"]
]person2 brought weapon1
rules = ['("person2" "weapon1" "*")']person1 was at place2
rules = ['("person2" "*" "place2")']nobody put weapon1 at place3
rules = ['(not ("*" "weapon1" "place3"))']*person1 admired the person who brought weapon2
rules = ['(not ("person1" "weapon2" "*"))']either person1 brought weapon2 or weapon2 was at place1
rules = ['(xor ("person" "weapon2" "*") ("*" "weapon2" "place1"))']This project uses poetry for development. Development is being done using python3.13.
Setup
poetry env use 3.13
poetry install
pre-commit install --install-hooks
This project uses pre-commit and poe to run tests and checks.
poe test- run ruff and pytestpoe cli- run the cli locally