What this is?
One-file, pure JS + JSON solver for a 5×5 KenKen-style Latin puzzle. Edit the JSON, then click Run ARC.
- Data — grid
N=5 and cages. A cage has an operator (= + - × ÷) and a target applied to its cells.
- Policies — declarative constraint families: row/column all-different and cage arithmetic.
- Answer — newly derived facts (the solved digits), with a checks summary.
- Reason Why — mathematical-English explanations per cage and row/column uniqueness.
- Check — auto-generated assertions (rows, columns, cages): … items.
Engine: domain propagation (1..N), cage tuple filtering, Latin all-different, and DFS backtracking. Works well up to N≈6 for typical puzzles.
Puzzle Details
- Size: 5×5 (values 1..5). Latin rule: each row/column has each number exactly once.
- Operators:
= (singleton), + (sum), - (absolute diff, two cells), × (product), ÷ (integer division, two cells, no remainder).
- Design: Mixed singletons, sum pairs, and difference pairs for medium difficulty.
- Editing: You can alter
size (2..6) and cages. Ensure every cell appears in exactly one cage.
- Tip: Singletons seed values; all-different prunes domains; cages do arithmetic pruning; backtracking finishes.
Data (JSON)
Coordinates are 1-based: [row, col]. Every cell belongs to exactly one cage.
Policies (declarative JSON rules)
Uniqueness Probe
(toggle “Probe uniqueness” then Run)
Answer (newly derived facts)
computing…
Reason Why (mathematical English)
(click “Run ARC”)