Skyscrapers Puzzles, Explained
After reading this you can read every edge clue in a skyscrapers puzzle, reason from the extreme clues first, and understand why a generator can safely blank most of the clues while keeping one solution.
What a skyscrapers puzzle is
A skyscrapers puzzle is a Latin square with a viewing rule. You fill an N by N grid so that each row and each column contains the heights 1 to N exactly once, just like the digits in a Latin square. The twist sits on the outside edges. Each number printed along an edge tells you how many towers you can see when you stand on that edge and look down the row or column.
A tower is visible if every tower in front of it is shorter. A taller tower hides everything shorter behind it. Consider the line 2 1 4 3 read from the left. You see the 2 first. The 1 is shorter, so it hides. The 4 is taller than everything so far, so it shows. The 3 is shorter than the 4, so it hides. You saw the 2 and the 4, which is two towers. The clue on that side would be 2.
The two rules together make a tight logic puzzle. The Latin square constrains what can go in each cell, and the visibility clues pin down the order.
When to use it, and when not
Reach for skyscrapers when you want a puzzle that teaches ordering and counting at the same time. A 4 by 4 grid suits ages 8 and up and takes most adults under three minutes. A 5 by 5 is a solid classroom warm-up. A 6 by 6 or 7 by 7 is a serious sit-down puzzle, closer to fifteen minutes for an experienced solver.
Skip skyscrapers if your solvers have never met a Latin square. Start them on a small Sudoku Generator puzzle so the "each symbol once per line" habit is automatic, then add the visibility rule. If you want inequality reasoning without counting, Futoshiki uses the same grid sizes with a gentler rule.
For a first lesson, use a 4 by 4 with all clues shown. That size has only 576 valid Latin squares, so most children can reach the answer by patient counting rather than deep deduction.
The clue math and why the extremes matter
For a line of length N, the clue value c always lands between 1 and N. Two values give away almost the whole line at once.
Here c is the clue and N is the grid size. A clue of N means you see every tower, which is only possible when the heights climb steadily from nearest to farthest. There is exactly one arrangement that satisfies it.
A clue of 1 means you see only one tower, so the tallest tower must sit right at the edge, blocking everything. The rest of that line stays open.
Between the extremes, counting the number of arrangements that produce a given clue uses unsigned Stirling numbers of the first kind, written \left[ {N \atop c} \right]. The count of length-N permutations with exactly c visible towers from one end equals that Stirling number.
The symbol V(N, c) is how many orderings of 1 to N show exactly c towers. For N = 4 the four counts are 6, 11, 6, 1 for c = 1, 2, 3, 4, and they sum to 24, which is 4!. That confirms the numbers: every one of the 24 orderings of a four-tower line falls into exactly one clue bucket.
A worked 4 by 4 example
The demo button builds a 4 by 4 puzzle. Work through one line so you can see the deduction style. Suppose the top edge of the first column shows the clue 4, and the left edge of the first row shows the clue 1.
Solving from two extreme clues
- The top clue of column 1 is
4. By the rule above, the column reads1, 2, 3, 4from top to bottom. Cell R1C1 is1. - The left clue of row 1 is
1. That forces the tallest tower,4, into the leftmost cell R1C1. But step 1 put1there, a contradiction, so this pairing cannot occur in a valid puzzle. - Swap the example: keep the top clue of column 1 as
4, so the column is1, 2, 3, 4. Now read row 1. Its first cell is fixed at1. A row starting with1hides nothing behind height differences until a taller tower appears, so every later peak is visible. - If row 1 continues
1, 3, 2, 4, you see1, then3(taller), then2hides, then4(taller). That is three visible towers, so the left clue of row 1 would read3.
The lesson: attack the N and 1 clues first because each collapses a whole line or fixes one cell. From there the Latin square rule propagates the rest.
Reading a finished puzzle and checking your work
When you finish, verify every edge clue, not just the ones you used. A common trap is to satisfy the Latin square and three clues, then leave a fourth clue violated. Walk each line from its clued edge, count the running maximum, and confirm the visible count matches.
Here is a full valid 4 by 4 solution grid and its four left-edge clues, so you can practice the count.
| Left clue | Col 1 | Col 2 | Col 3 | Col 4 |
|---|---|---|---|---|
| 4 | 1 | 2 | 3 | 4 |
| 3 | 2 | 1 | 4 | 3 |
| 2 | 3 | 4 | 1 | 2 |
| 1 | 4 | 3 | 2 | 1 |
Check row 2: heights 2, 1, 4, 3. You see 2, the 1 hides, the 4 shows, the 3 hides. Two visible, but the clue says 3. That mismatch means this grid is not consistent with the stated clue, which is exactly the kind of error you catch by recounting. The correct left clue for row 2 is 2, not 3.
Every puzzle from the generator is checked by a backtracking solver and shown only if it has exactly one solution. The table above is a teaching illustration of a manual counting slip, not generator output.
How the generator decides which clues to keep
The generator first builds a full solution, a random Latin square that also fits chosen clues. Then it removes clues one at a time. After each removal it runs the solver again. If the puzzle still has exactly one solution, the clue stays blank. If removing it allows a second solution, the clue goes back.
Difficulty is just how aggressively this pruning runs. On easy, all edge clues stay and a few cells are given. On hard, the solver blanks every clue it can prove redundant, so you may face a grid with clues on only two sides.
Common mistakes
The counting rule is simple, but three errors show up again and again.
- Counting height, not visibility
- The clue does not add the heights or report the tallest tower. It counts how many towers you see. A line
4, 1, 2, 3shows only the4, so the clue is1, even though tall towers sit behind. - Forgetting the running maximum resets nothing
- Visibility depends only on the tallest tower seen so far. Once you pass a
4in a four-tower line, nothing behind it can ever be visible from that side. - Trusting three clues out of four
- A Latin square that satisfies most clues can still fail one. Always recount the last line.
Do not assume a blank edge means "no constraint." A blanked clue was removed only because the rest of the puzzle already forces that line. It still has a definite value in the finished grid.
Related puzzle generators
If you like the Latin square base, the KenKen (Calcudoku) Generator keeps the "each number once per line" rule and adds arithmetic cages instead of visibility. For counting clues along edges of a different kind, the Nonogram Maker turns a picture into row and column run-length clues. The Kakuro Generator uses cross sums, another edge-clue style with a guaranteed unique solution.
Frequently asked questions
What do the numbers on the outside of a skyscrapers puzzle mean?
Each edge number counts how many towers you can see looking into that row or column. Taller towers hide shorter towers behind them, so the count is the number of new tallest-so-far towers as you scan inward.
Is a skyscrapers puzzle just a Latin square?
The grid is a Latin square: each height from 1 to N appears once per row and once per column. The edge clues then select one specific Latin square by constraining the visible order.
Why are some edge clues blank?
The generator removes any clue the solver can prove unnecessary while keeping exactly one solution. A blank edge still has a fixed value in the answer; it just is not needed as a hint.
What grid sizes work best for classrooms?
Use 4 by 4 for first-timers and 5 by 5 once the rule is clear. Save 6 by 6 and 7 by 7 for solvers who already finish a 5 by 5 without checking.
How do I check my own answer?
Confirm the Latin square first, then walk every clued edge, track the running maximum, and count the visible towers. All four sides must match their clues.