Guides

How to solve nonograms: line by line

The three techniques behind every nonogram on Point Paper, from run overlap to a short what-if test, with worked examples, a solving routine and the mistakes to avoid.

Updated

A nonogram gives you numbers and asks for a picture. Every row and every column is a small puzzle of its own, and all the reasoning happens one line at a time: you look at a single line, its clue and the squares already settled in it, and ask which squares must be filled and which must be empty. The picture is the reward, not the method. This guide covers the three techniques our solver uses to rate every Nonogram on the site, in the order the difficulty levels introduce them. The hints describe each step in the same terms.

Reading a clue

A clue such as 3 1 says that the line contains a run of three filled squares and, somewhere after it, a run of one, with at least one empty square between them. It says nothing about how many empty squares come before, between or after the runs. The order of the numbers is fixed; their positions are what you have to work out. A clue of 0 means the whole line is empty. Row clues are read left to right and column clues top to bottom.

You have two marks: a filled square and a cross for a square you have proved empty. Crosses are not decoration. Almost every technique below gets stronger as crosses appear, because they shrink the space the runs can move in. How to play explains how to switch between Fill and Mark empty and how dragging along a line works.

The one number worth computing: slack

For any line, add up the numbers in the clue and add one for each gap between runs. That total is the shortest stretch the clue can fit into. Subtract it from the length of the line and you have the slack: how far the whole clue can slide. A clue of 2 5 in a row of ten needs 2 + 1 + 5 = 8 squares, so its slack is 2.

Slack tells you most of what an empty line holds. If it is zero, the clue fills the line exactly and you can fill it in straight away. If a run is longer than the slack, part of it is certain: exactly (run − slack) squares. If no run is longer than the slack, the empty line gives nothing yet, and you should look elsewhere.

What Easy puzzles need: run overlap

An Easy puzzle is a 5×5 or 10×10 grid that can be finished using run overlap alone, one line at a time. Run overlap is a family of small, quick checks that all rest on the same idea: find the earliest and the latest place each run could sit, and see what those two positions agree on.

Overlap in an empty line

A 7 in a row of ten has three squares of slack. Whether it starts in column 1, column 4 or anywhere between, it covers columns 4 to 7.

Push the run as far left as it will go, then as far right. A square covered in both positions is covered by every position between them, so it is filled whatever the answer. For a single run the quick test is simple: in a line of ten, a run of six or more always gives you something; in a line of fifteen, a run of eight or more.

With several runs, pack them all to the left, keeping one square between them, then all to the right, and compare each run with itself. Slack does the counting for you.

The clue 2 5 needs eight of the ten squares, leaving two spare. The 2 is no longer than the slack, so it gives nothing, but the 5 always covers columns 6 to 8.

Crosses and edges shrink the line

A run cannot sit on a cross, so a cross works like the end of the line. That has two effects. A gap between two crosses, or between a cross and the edge, that is too short for any run that could reach it must be empty. And the space that is left behaves like a shorter line, with less slack and more overlap.

Column 4 was already crossed. The three squares to its left can’t hold a 5, so they are empty. The six squares to its right leave the 5 one square of slack, so it covers columns 6 to 9.

Tip: every time you cross a square, glance along both of its lines for pockets that no run can use.

A filled square near the edge

If a filled square sits so close to the start of the line that the second run could never reach it, it must belong to the first run, and the first run cannot start more than its own length before it. The same holds at the other end for the last run. Once the run is pinned to a short range, the overlap gives more squares and everything beyond its reach is empty.

Column 2 was already filled. The 3 must cover it, so it starts in column 1 or column 2. Column 3 is filled either way, and columns 5 to 10 are out of reach.

Finishing a line

Two checks close lines off. When the filled squares in a line add up to its whole clue, every other square is empty: cross them at once, before you forget. And a block of filled squares as long as the longest run in the clue is already complete, so both squares beside it are empty. In a row whose clue is 3 1, a block of three filled squares can only be the 3, and it gets a cross at each end.

Every square you settle also belongs to a line running the other way. The rhythm of an Easy puzzle is to finish what one line gives, then turn to the lines that crossed it, because they have just changed.

What Medium puzzles need: checking every arrangement

A Medium puzzle is either a 5×5 or 10×10 grid that needs checking every arrangement at least once, or a 15×15 grid that run overlap can finish on its own. The large Medium grids ask for nothing new, only more lines and more careful counting. The thick rules every five squares help you count positions without losing your place.

Checking every arrangement is the complete version of line reasoning. Consider every way the clue could be placed in the line that agrees with the squares already filled and crossed. A square filled in all of them is filled; a square empty in all of them is empty. Run overlap is a shortcut that looks only at each run’s two extreme positions; it misses deductions that depend on working out which filled square belongs to which run.

Columns 3 and 4 were already filled. Two filled squares side by side can’t be the 1, so they belong to the 3. The 3 can’t start in column 2, because the 1 and its gap would need two squares to the left. The only arrangement left puts the 1 in column 1 and the 3 in columns 3 to 5.

You rarely need to list the arrangements one by one; a few questions find most of these steps:

  • Which runs could this block be? A block of filled squares can only belong to a run at least as long as the block. If just one run qualifies, the block is that run, and the runs before and after it need room on their own sides.
  • Would joining two blocks make a run too long? In a row with clue 1 2 and filled squares in columns 3 and 5, filling column 4 would make a block of three, longer than any run. So column 4 is empty, the two blocks are the 1 and the start of the 2, column 6 is filled and every other square is empty.
  • Is this gap big enough for the run that must go in it? Once runs are tied to regions of the line, a pocket between crosses may be too small for the run that would have to use it.

Tip: this pays best on lines with several known squares and a clue of two or three runs, which usually have only a handful of arrangements left.

What Hard puzzles need: a short what-if test

A Hard puzzle either needs checking every arrangement on a 15×15 grid, or reaches a point where no single line can tell you anything more, even with every arrangement checked. The step that breaks the deadlock is a contradiction: suppose one square is filled (or empty), follow the ordinary line reasoning from there, and if some line ends up with no way to fit its clue, the square must have the other value.

This is not guessing. You never keep the supposition. You follow it only until it breaks, and what you write down is the opposite, which is now proved.

A Hard 5×5 grid where every line is stuck. Suppose the top-left square were empty: row 1 would need its 1 in column 2, column 2 would then be complete, and column 1’s 3 would have to reach down to row 4. Row 4 would start with a filled square followed by an empty one, which can’t be part of a 3. So the top-left square is filled.

Follow it step by step. Row 1 has the clue 1 2, with its 2 already in columns 4 and 5 and column 3 crossed. If column 1 were empty, the 1 would have to be in column 2. Column 2 has the clue 3 and would then be filled in rows 1 to 3, so row 4 of column 2 would be empty. Column 1 also has the clue 3, but with row 1 empty its run could only be rows 2 to 4, so row 4 of column 1 would be filled. Now row 4, whose clue is 3, would read filled, empty, filled: the first square would be a run of one. That line cannot fit its clue, so the supposition was wrong. With the top-left square filled, the rest of the grid follows line by line.

Some tips for choosing where to test:

  • Pick a square whose row or column is nearly settled, where one value would force several others. Short chains are easier to follow and more likely to break quickly.
  • Keep the test in your head if you can. If you must put marks down on screen, count your moves, so that Undo takes you back exactly to where you started.
  • If a few steps pass without a contradiction, stop and choose another square. A test that doesn’t break proves nothing about the value you assumed.

A solving routine

  1. Cross every line whose clue is 0, and fill every line whose slack is zero.
  2. Work out the slack of each line and apply the overlap wherever a run is longer than it.
  3. Follow the changes. After finishing a line, visit the lines that cross it, starting with the ones that just gained the most squares.
  4. Close lines off as you go: cross the rest of a complete line and cap blocks as long as the longest run.
  5. When run overlap runs dry, check every arrangement on the lines with the most known squares.
  6. Only when every line is stuck, pick a square and run a short what-if test.

Common mistakes

  • Forgetting the gaps. Runs need at least one empty square between them. Leaving the gaps out of the slack makes the overlap look bigger than it is, and the extra squares are wrong.
  • Deciding too early which run a square belongs to. In a row with clue 1 3, a single filled square in the middle could be the 1 or part of the 3. Check before you build on it.
  • Not marking empty squares. A proved empty square left blank is lost information, and many later steps depend on crosses.
  • Following the picture. It is tempting to finish a shape because it looks like an ear or a wheel. The clues decide; the picture only confirms.
  • Reading the wrong clue. On a large grid it is easy to use the clue of the neighbouring line. Selecting a square highlights the clues of its row and column; use that when counting.

Using hints

A hint always shows the easiest kind of step available: run overlap first, then checking every arrangement, then a what-if test. Among line steps it picks the line that settles the most squares and says why. If your board already contains a wrong square, the hint says so instead of building on it; use Check to find it. As Getting started suggests, read the explanation, then look for the same pattern elsewhere on the board.

The quickest way to learn these techniques is to use them. Start with an Easy 10×10 nonogram, count the slack on every line before filling anything, and see how much of the picture appears from that alone.

Play nonograms