GenerateRandomSearch

Skyscraper Puzzle Generator

Each cell holds a building of a different height, one of each per row and column. The numbers around the outside tell you how many buildings you can see looking along that line, where a taller building hides every shorter one behind it. A clue of 1 means the tallest is nearest you; a clue equal to the grid size means they rise one at a time. Everything else has to be deduced. There are no given digits at all in most of these — the entire solve comes from the edges.

What this generator does

Builds a completed Latin square, works out how many values are visible along every line from all four sides, then removes edge clues one at a time and keeps a removal only while the puzzle still has exactly one solution. What is left is a minimal set: take away any single number from the border and the puzzle becomes ambiguous.

How to use this tool

  1. Choose a grid size. Four is approachable; five and above get demanding quickly.
  2. Press make a puzzle. The numbers around the edge are the visibility counts.
  3. Fill each row and column with 1 to the grid size, once each.
  4. Reveal the answer to check, or seed the puzzle to share the same one.

Understanding the controls

Size
From 4 to 6. Every clue removal is verified by an exhaustive solve, so the larger sizes take a visible moment — about 900ms at 6 by 6. Seven is deliberately not offered: it did not finish in five minutes when measured.
Seed
Any word reproduces the same puzzle, which is what makes a shared or printed set possible.
Show the answer
Reveals the grid the clues were derived from — the unique solution, not a re-solve.

Common use cases

  • A logic puzzle that teaches ordering and visibility reasoning rather than arithmetic
  • A step up for someone who has exhausted Sudoku and futoshiki
  • A classroom exercise in reasoning from indirect evidence
  • A printable puzzle where the clue set is guaranteed minimal
  • Demonstrating that a small number of outside observations can determine a whole grid

How this generator works

Visibility is counted with the tallest-so-far rule: walking along a line, a value is visible only if it is taller than everything before it. Every line is measured from all four sides to produce the full clue set, then clues are removed while an exhaustive solver still finds exactly one solution. Where the edge clues alone cannot determine the square — which does happen — a cell is revealed first, and then tested to see whether it can be removed again once the clue set has been reduced.

Randomness and fairness

The square and the order clues are tested in are random. Without a seed the draw uses the browser's cryptographically secure generator; with a seed a small deterministic one, which is reproducible and therefore explicitly not cryptographically secure.

For how randomness is produced across the whole site, see how Generate Random works.

Assumptions this tool makes

  • Each row and column holds every height from 1 to the grid size exactly once.
  • A building hides all shorter buildings behind it, and only taller ones are visible past it.

Limitations and good to know

  • Difficulty is not graded. Minimal is not the same as easy, and some minimal puzzles are much harder than others of the same size.
  • Sizes stop at 6. Verification by exhaustive solve grows steeply, and a 7 by 7 did not finish in five minutes when measured.
  • It confirms the answer but will not explain the deduction step by step.
  • Nothing persists between visits, so seed anything you want to keep.

Common mistakes

Forgetting that a taller building hides everything behind it
Visibility is not a count of buildings, it is a count of new maximums. 3 1 2 4 shows two, not four.
Ignoring the two extreme clues
A 1 places the tallest immediately. A clue equal to the grid size fixes the whole line. Both are free information and should be used first.
Treating opposite edges separately
The clues on the two ends of a line constrain each other. A pair like 2 and 3 on a 4-wide line leaves very few arrangements.

Practical tips

  • Start with any 1 or any clue equal to the grid size — they place values with no deduction at all.
  • Then look at pairs of clues on opposite ends of the same line; together they are far more restrictive than either alone.
  • A clue of 2 on a 4 grid means the tallest is in one of the first two positions, which is often enough to break a deadlock.

Privacy and your data

Everything is generated in your browser. No puzzle, seed or solution leaves the page or is stored between visits.

Frequently asked questions

Can it be solved from the edge numbers alone?
Usually, and where it cannot, a cell is revealed so that the puzzle still has exactly one answer. The generator checks this rather than assuming it.
What does a clue of 1 mean?
The tallest building is nearest you, hiding everything else on that line. It is the most useful clue on the board and worth finding first.
Why does a larger grid take longer to appear?
Because every clue is tested for necessity by solving the puzzle exhaustively without it. That is what guarantees the clue set is minimal, and it is why 6 by 6 is the largest size offered.