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.…