Skip to content
Puzzle Quarry

The Rules of Skyscrapers

Three rules, and two of them are misread far more often than they are hard. Here is each one shown on a small board rather than merely stated.

Rule one: each height once along every street

On a board of side n the heights run from 1 to n, and each of them stands exactly once in every row and exactly once in every column. That is the entire grid rule. There is no third kind of line, no box, no diagonal, and nothing carries over from one board to the next.

It is worth being precise about what "exactly once" buys you, because it is more than it looks. A row is not merely free of repeats; it is a complete set, so the tallest tower is somewhere in every row and every column of every board ever printed, and so is the shortest. Knowing where one of them cannot be is therefore knowledge about where it is, which is most of what the middle of a board consists of.

The figure below shows a finished four alongside a grid where every number on the left edge is correct and the board is nonetheless wrong, because two columns have the same height standing twice. Getting the views right is not the same as getting the puzzle right, and the two come apart in exactly this way.

Four numbers, one edge, and nothing given away
2
2
1
3
Illegal — every view on the left is right, and two columns repeat
21423
22143
14231
32314
Legal — the same four views, with each height once per line
22143
23412
14231
31324

Rule two: the number counts what is in sight

Stand at the printed number and look in. You see a building when it is taller than everything you have already passed, and you do not see it at all when anything in front of it is taller. Count the ones you see, and that count is the number. Nothing about distance matters and nothing about the buildings behind matters; only the running tallest.

Take the street 2, 1, 4, 3 read from the left. The 2 is in sight because nothing is in front of it. The 1 is behind a 2 and is gone. The 4 clears both and is in sight. The 3 is behind the 4 and is gone. Two rooftops, so a 2 belongs at that edge and a 3 does not, and there is no interpretation under which it does.

The figure here shows a board with a single 1 printed above the third column, filled two ways. In one the column starts with its tallest tower and everything behind it disappears, which is the only arrangement a 1 permits. In the other the column is a perfectly good set of heights in a perfectly good order and two roofs are in sight, which makes the printed number false and the grid wrong.

Illegal — two roofs are in sight and the number says one
1
1234
2143
3412
4321
Legal — the tallest tower stands first and hides the rest
1
2143
3412
4231
1324

Rule three: a blank edge is not a nought

This is the one people get wrong first. An edge with no number against it is not telling you that nothing is in sight — it is telling you nothing whatsoever. A view of nought is impossible on any board of any size, because whatever else is true, the building nearest you is in front of everything and therefore in sight.

What a blank actually means is that the setter had that number, took it away, and confirmed the board still had exactly one answer without it. Every blank on every board here has been through that check. So a bare-looking rim is not a board with fewer facts on it than a busy one; it is a board where more of the facts turned out to be consequences of the others.

The related habit is reading both ends of a street. A row with a 2 at its left edge and a 2 at its right is not two independent facts to be spent one at a time — it is one statement about one ordering, and the arrangements satisfying both are far fewer than either number allows alone. The figure below shows a row obeying its left number exactly while making a liar of the number facing it from the other side.

Illegal — the left number is right and the right one is not
231242
1243
2431
4312
Legal — the same row read from both pavements at once
221432
3412
4231
1324

Three things people assume the rules say

They do not say a number counts the buildings in the row. It counts the ones in sight, which on a side of six is somewhere between one and six and is usually two or three. A 6 against a six-wide street is a rare and enormously helpful thing rather than the normal case.

They do not say the two numbers at the ends of a street have to add to anything in particular, except that they cannot add to more than one plus the side. That is a real constraint and it is worth knowing, because a pair like 4 and 4 on a side of five is impossible and would never be printed.

And they do not permit guessing. Every board published here was checked to be finishable by argument alone before anybody saw it, so a board that will not move is one where something has been missed rather than one that wants a coin. That is a promise about the generator, and it is why the generator stops rubbing numbers out exactly when it does.

Common questions

Does a taller building hide more than one behind it?

It hides every shorter building behind it, however many there are and however far away. Only a tower taller than everything already passed comes into view.

What does a 1 on the edge tell me?

That the lot nearest that edge holds the tallest tower on the board, because nothing else can block an entire street on its own. It is the single most useful number a rim can carry.

Can the two numbers facing each other along one street be anything?

Not quite. Their total can never be more than one greater than the side of the board, because the tallest tower is in sight from whichever end it is nearer and is counted only once between them.

More Skyscrapers pages