What this is?
A one-file, pure JS + JSON solver for a 10×10 Nonogram (Picross). You provide row/column run clues; the solver constructs all line patterns consistent with clues and current assignments, propagates forced cells, and backtracks only if needed.
- Data — grid size and
rows/cols clues (arrays of run lengths).
- Policies — declarative constraints: each row/column’s runs must match its clue; cells are either
fill or empty.
- Answer — derived facts (
cell(r,c)=fill/empty).
- Reason Why — mathematical-English explanations per propagation step (line candidates → forced cells).
- Check — row/column validity, full assignment, and candidate sanity (… items).
Tech: complete enumeration of line patterns from clues; intersection forcing; alternating row/column propagation; DFS with smallest-domain branching; proofs are recorded as “forced by line X”.
Puzzle Details
- Size: 10×10. Values are
fill (■) or empty (□).
- Clues: Each clue list [a,b,c,…] means contiguous runs of
fill with ≥1 empty between runs.
- Editing: Change the JSON clues; keep rows = 10 and cols = 10 for this demo.
- Tip: Larger puzzles work too (12–15), but the solver is exponential if clues are loose.
■ = fill
□ = empty
Data (JSON)
All arrays must be valid JSON. Coordinates are 1-based in the Answer section.
Policies (declarative JSON rules)
Uniqueness Probe
(toggle “Probe uniqueness” then Run)
Answer (newly derived facts)
computing…
Reason Why (mathematical English)
(click “Run ARC”)