The Skyscrapers puzzle is a number logic puzzle on a square grid. Every square holds a building, every row and column has one building of each height, and the clues around the edge tell you how many buildings you can see from there. This version has three sizes and two levels, and every grid it makes has exactly one answer.
Skyscrapers puzzle rules
A Skyscrapers puzzle is a square grid, 4×4, 5×5, or 6×6 here. Each square is a building between 1 and the size of the grid in height. Two rules decide where every building goes:
- One of each height in every row and column. On a 5×5 grid, each row and each column holds buildings 1, 2, 3, 4, and 5 exactly once, like a Sudoku without the boxes.
- The edge clues must match. A number outside the grid says how many buildings you'd see standing at that spot and looking along the row or column. Taller buildings block the view of shorter ones behind them.
Some puzzles also start with a few heights in place, and those can't be changed. Fill every empty square correctly and a card shows your time, mistakes, and hints.
How the clues in a Skyscrapers puzzle work
Picture yourself at the end of a street, looking down a row of towers. A building only counts if it's taller than every building in front of it.
Take the row 2 1 4 3 on a 4×4 grid. From the left you see the 2, the 1 hides behind it, then the 4 rises above both and hides the 3: two buildings, so the left clue is 2. From the right you see the 3 and then the 4, so that clue is 2 as well. Clues run from 1 to the size of the grid:
- 1 means only the tallest building is visible, so it's right next to the clue.
- The grid size, such as 4 on a 4×4, means every building is visible, so the heights climb in order: 1, 2, 3, 4.
- Anything in between leaves several possibilities, and the other clues and the one-of-each rule narrow them down.
A row or column can have a clue at both ends, at one end, or, on Hard, none at all.
Sizes and levels: 4×4 to 6×6, Easy or Hard
Choose a size and a level under New puzzle. A 4×4 grid uses heights 1 to 4 and is the place to learn how the clues behave. A 5×5 grid uses heights 1 to 5, and a 6×6 grid uses 1 to 6.
The generator starts from a random finished grid with every clue and height showing, then removes heights one at a time, in random order, as long as a solver can prove there's still exactly one answer. Easy stops there, so every row and column keeps both of its clues, plus any starting heights the clues alone can't settle. Hard goes on to remove edge clues the same way, so every clue and starting height that's left is needed.
Change the size or level partway through and your current grid stays until you press Start a new puzzle.
Clue strips that react as you play
The clues sit in four strips around the grid, one number at each end of a row or column, with a blank wherever Hard took one away. Select a square and the clues for its row and column light up. Once a line is full, its clues fade if the buildings match them and turn red if they don't, which tells you which end of the street is off.
- Touch or mouse: pick a square, then a height on the keypad, which shows how many of each are still to place. Choosing the same height a second time clears the square.
- Keyboard: the arrows move and a digit places that height. Shortcuts for notes, undo, and hints are printed under the grid and match Calcudoku.
- Screen readers: each square's label ends with its clues, such as "row clues 2 from the left and 3 from the right; column clue 1 from the top".
Notes beside the clues, hints, and mistakes
Notes pay off most beside a clue, where the height limit already rules out the tall buildings. Pencil in candidate heights with the Notes button, N, or Shift plus a number. Placing a height removes it from the notes in the same row and column.
Show mistakes starts on, so a wrong height turns red and the status line above the grid says it doesn't go there. Either way, two equal heights in one line turn red, and the Mistakes counter adds one for every height you place that isn't in the answer.
Hint corrects a wrong height before anything else. Otherwise it places a forced building, in your selected square when it can, and tells you whether the edge clues were needed or the row and column alone decided it. Undo takes back your last change, one step at a time.
The 1s first, then the tallest buildings
An order of work that holds up on every size:
- Start with the 1s and the clues equal to the grid size. They place buildings straight away.
- Find the tallest building in every row and column next. Every clue depends on where it stands.
- Next to a clue of 2 on a 4×4, the first square can't be a 4, or you'd only see one building.
- Compare the clues at both ends of a line. A 1 opposite a 2 fixes both end squares.
- Use notes on 5×5 and 6×6, where there are too many options to keep in your head.
If you like this kind of reasoning, Futoshiki uses the same one-of-each grid with greater-than and less-than signs, and Calcudoku adds math cages.
The math behind Skyscrapers: Latin squares
A grid with every number exactly once in each row and column is called a Latin square. Leonhard Euler studied them in the 18th century, and a solved Sudoku is a Latin square with extra box rules. The count grows fast: there are 576 different 4×4 Latin squares, 161,280 of size 5×5, and 812,851,200 of size 6×6. The edge clues of a Skyscrapers puzzle pick out exactly one of them.
Counting visible buildings is the same as counting records in a list: numbers bigger than everything before them. Of the 24 ways to order heights 1 to 4 in a row, 6 show one building from the left, 11 show two, 6 show three, and only 1 shows all four. Those counts are the Stirling numbers of the first kind.
Both ends of a line see the tallest building, so clues at opposite ends add up to at least 3 and at most the size plus 1. In general, completing a partly filled Latin square is hard for computers too: Charles Colbourn proved it NP-complete in 1984.
The Skyscrapers puzzle at the 1992 World Puzzle Championship
Skyscrapers grew out of older Latin-square puzzles and was created in Japan. According to the puzzle site Grandmaster Puzzles, it got its first wide exposure at the 1st World Puzzle Championship in New York in 1992, when the Japanese publisher Sekai Bunka-sha handed competitors an English edition of its Puzzler magazine. Who first invented it isn't recorded.
It also goes by names such as Towers and Building puzzle. This version was written for this site.
Records for each size and level
The clock starts with your first number or hint and pauses while the tab is hidden. Your records shows puzzles solved and your best time for each size at the selected level, so Easy and Hard keep separate records. Beat your best and the result card says so. Reset records clears every size and level.
What the puzzle saves, and what it doesn't
No account is needed. Your settings, the city you're building with its heights, notes, mistakes, hints, and clock, and your records sit in one local storage entry in this browser, so a half-finished 6×6 is waiting when you come back. The page needs a connection to load, but each grid is generated in your browser, and the heights you place and your times aren't sent to a server. The privacy policy lists the one entry the puzzle stores.