Menu

1 / 5

Is Your Nonogram Unique? Line Solvers and No-Guess Puzzles

DEV Community: kotlin·Nesim Razon·10 days ago
#iPSppQhI
#devtokotlin#devto#dev#filled#line
Long article (1303 words) — no AI summary yet.
Reading 0:00
15s threshold

A nonogram looks simple: numbers on the edges, squares to fill. The hard part for a puzzle maker is making sure the picture has one answer and that a player can reach it by pure logic. Here is how a small line solver does that check, and how I use it to generate snowflake pictures in a winter puzzle app.

What a nonogram is

A nonogram is a grid with numbers beside every row and above every column. Each number says how many filled squares in a row sit together on that line. Between two groups there is at least one empty square.

Example for a line of 5 squares:

Clue 3 1: three filled, one empty, one filled. Only one arrangement fits: filled, filled, filled, empty, filled.

Clue 2 1: three arrangements fit: filled-filled-empty-filled-empty, filled-filled-empty-empty-filled, or empty-filled-filled-empty-filled.

Clue 0: the whole line is empty.

When every row and column is correct, the filled squares form a picture.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.