Budi GamesQuiet puzzles, one at a time

Nonogram solving basics

A nonogram is a grid with lists of numbers along the top and down the side, and a picture hidden inside it. Nothing about the first encounter is intuitive: the numbers are not coordinates, they are not a score, and there is no obvious square to start with. Most people fill in a few squares by feel, discover the feel was wrong, and never come back.

The good news is that a nonogram is one of the most systematic puzzles there is. Almost every square you will ever fill comes from one short calculation applied to one line at a time, and that calculation is easy enough to do in your head after a few grids. This guide covers what the numbers mean, the arithmetic that produces certain squares, why marking empty squares matters more than beginners expect, and how to tell that a line has nothing left to give you. You can follow along on our Pixel Logic grid.

What the numbers actually say

Each line — every row and every column — has its own list of numbers, and each number is the length of one unbroken run of filled squares in that line. We will call those runs blocks. The numbers appear in the order the blocks appear, reading left to right for a row and top to bottom for a column, and there must be at least one empty square between two consecutive blocks.

So a row of ten squares marked 4 3 contains a run of exactly four filled squares, then at least one empty square, then a run of exactly three, and every other square in that row is empty. Note the two things the clue does not tell you: where the blocks begin, and how big the gaps are. That is the whole puzzle.

Throughout the diagrams below:

   #   filled square
   X   square you have proved is empty
   .   square you know nothing about yet

Slack: the one number to compute first

Before touching a line, work out how much room it has to spare. Add up the clue numbers, add one square for each gap between them, and subtract the total from the length of the line. What is left is the line's slack — the amount the whole arrangement can slide.

A ten-square row with the clue 4 3 needs 4 + 1 + 3 = 8 squares at minimum, so the slack is two. A ten-square row with the single clue 7 has a slack of three. A ten-square row clued 3 has a slack of seven.

Slack is the whole game, because of one rule: a block longer than the slack has squares that are certain, and a block no longer than the slack has none. Compute the slack, compare it to the biggest number in the line, and you know in two seconds whether the line is worth your time.

Overlap, drawn out

Here is why the rule works. Take the ten-square row clued 7. Push the block as far left as it will go, then as far right as it will go, and compare:

   column      1  2  3  4  5  6  7  8  9 10
   far left    #  #  #  #  #  #  #  X  X  X
   far right   X  X  X  #  #  #  #  #  #  #
   certain     .  .  .  #  #  #  #  .  .  .

Columns 4 through 7 are filled in both extremes, and since every legal position of the block lies somewhere between those two extremes, those four squares are filled in every possible solution. Four is also 7 − 3: the block length minus the slack, exactly as the rule says. You have not worked out where the block starts, and you do not need to.

Now the two-block version, and this is where beginners make a specific mistake worth naming. The row is ten squares, the clue is 4 3, the slack is two. Call the blocks A and B:

   column          1  2  3  4  5  6  7  8  9 10
   everything L    A  A  A  A  X  B  B  B  X  X
   everything R    X  X  A  A  A  A  X  B  B  B
   certain         .  .  #  #  .  .  .  #  .  .

Compare each block against itself, never the two rows square by square. Block A runs from 1–4 at the far left and from 3–6 at the far right, so columns 3 and 4 belong to A in every arrangement: that is 4 − 2 = two certain squares. Block B runs from 6–8 at the far left and from 8–10 at the far right, so only column 8 is certain: 3 − 2 = one square.

Column 6 is filled in both of the drawn rows, but by different blocks — A on the right-pushed row, B on the left-pushed one — and there are perfectly legal arrangements, such as A at 2–5 and B at 7–9, that leave column 6 empty. Reading the diagram square by square would have you fill it in and break the puzzle. Per block, always.

An X is worth as much as a filled square

Beginners chase filled squares because filled squares are the picture. But the empty ones carry just as much information, and often more, because an empty square cuts a line into two shorter lines and short lines are dramatically easier.

Take a ten-square row clued 6 — slack four, block length six, so overlap gives you two squares in the middle and not much satisfaction. Now suppose the column clues have already proved that column 4 is empty:

   column      1  2  3  4  5  6  7  8  9 10
   known       .  .  .  X  .  .  .  .  .  .

The line is now two segments: columns 1–3 and columns 5–10. A block of six cannot fit in a segment of three, so it must live in the second segment — which is exactly six squares long. The block is pinned to columns 5 through 10, the row is finished, and columns 1 to 3 are all empty. One X turned an almost informationless line into a completed one.

Three habits follow from this:

  • Cap every finished block. When you know a block is complete — say a run of three filled squares and the clue for it was 3 — put an X on the square at each end immediately. Those X marks are free, and they feed the columns.
  • Empty out satisfied lines. When a line's blocks are all placed, mark every remaining square in it as empty rather than leaving them blank. A blank square looks like an open question when you come back to it; an X does not.
  • Watch the ends. If the first square of a line is filled, the first block is anchored there: fill the rest of it and cap it with an X. The same applies at the far end, and these anchored starts are the most common way a grid opens up in the middle of a solve.

Rows, then columns, then rows again

A nonogram is not solved by finishing rows and then finishing columns. It is solved by alternating, because every square you settle in a row is new information for the column it sits in.

A workable loop looks like this. Compute the slack for every row and every column once, at the start, and note which lines have a block longer than their slack. Solve those lines — that is your opening, and on a well-made grid it usually gives you several squares in the middle rows and the fullest columns. Then, instead of moving to the next row down, look at the columns your new squares just changed. A column that previously had nothing to say may now have a filled square in a known position, which anchors a block, which fills more squares, which feeds another row.

The rhythm is: solve a line, then immediately re-examine every line that crosses the squares you just changed. Following the information is much faster than sweeping the grid in order, and it is the difference between a five-minute grid and a twenty-minute one.

Numbers we noted while solving these grids ourselves, so treat them as estimates. A small grid takes us roughly three to six minutes once slack and overlap are automatic, and a first attempt at the same grid, before those two ideas click, tends to run three or four times longer. The arithmetic is firmer than the timing: in our runs the opening pass — computing slack on every line and solving only the lines where a block exceeds it — settles somewhere between a fifth and a third of the squares before any cross-referencing begins.

Knowing when a line has nothing to give

Time on a nonogram is most often lost staring at a line that provably has nothing left to tell you. Two checks prevent it.

Compare the biggest clue to the slack. If the biggest number in the line is less than or equal to the slack, no block in that line has a single certain square, and no amount of looking will change that. A ten-square row clued 3, with a slack of seven, tells you literally nothing until something crosses it. Move on without guilt.

Ask whether anything changed. If you have already worked a line and no square in it has been touched since, the line cannot have new information. Re-reading it is pure repetition. Keep your attention on lines that gained a filled square or an X since you last looked.

When both checks come back negative across the whole grid, the answer is almost never a guess. It is usually a line you solved partially and never revisited after an X appeared in it, or a block you completed and forgot to cap. Sweep for uncapped blocks first — that single check has rescued more of our stuck grids than anything else.

Two small things that speed everything up

Work the most constrained lines first. Lines with a large clue relative to their length, or with many blocks, have little slack and therefore produce the most certain squares per second of thought. Lines with one small number are the last place to look, not the first.

And resist filling a square because the picture seems to want it there. The clues describe the image completely, so guessing at the subject adds nothing and can cost you the grid — a wrong square propagates into its row and its column at once, and by the time the contradiction shows up you will be several minutes from the mistake. Every square you fill should trace back to an arithmetic reason you could state out loud.

Questions players ask

What do the numbers mean?

Each one is the length of an unbroken run of filled squares in that line, listed in order, with at least one empty square between consecutive runs. The gap sizes are never given.

How does the overlap rule work?

Push a block as far as it will go one way, then the other, and fill the squares it covers both times. In numbers: block length minus the line's slack equals the count of certain squares.

Why bother marking empty squares?

Because an X splits a line into shorter segments, and blocks often fit in only one of them. A single X can finish a line that overlap alone barely touched.

Do I ever have to guess?

Treat guessing as a last resort and check for uncapped blocks first. A wrong square spreads into a row and a column simultaneously, so the cost of a bad guess is much higher than the time you save.

Keep going