Computing: Free Pascal Programming

Logic number puzzle: Skyscrapers.

Download Skyscrapers desktop application (Windows 64bit) Download Skyscrapers source code (Lazarus/Free Pascal)

Description: Classic puzzle game with numbers to be placed onto a grid. The rules of the game (as used in the actual version of the application, as there are several variations of the puzzle with rule extensions or even different rules) are as follows:
  1. The grid fields contain skyscrapers, represented by a number, that indicates there relative height.
  2. In each grid row and each grid column, a given height must occur exactly once.
  3. The numbers at the borders indicate, how many skyscrapers you can see, if you look from this point into a row or column.
  4. A skyscraper is only then visible, if all buildings in front of it are less in height.
The game is a typical logic game: In order to find the correct solution of the puzzle, you have to explore the clues given at the border of the grid and by logical thinking (concluding from what you know, that a given field must be a given number, or on the contrary, can't be a given number), determine, which number has to be written into which field. Examples: In a 5×5 grid, a "1" clue in a row column indicates, that the first field (seen from that point of view) necessarily is a "5"; in a 4×4 grid, a "4" clue indicates, that this row/column must have fields in sequence 1,2,3,4.
Build from an old application, that I started in 2018, the GUI of Skyscrapers is completely different from the one of my other logic puzzle applications. The numbers have to be entered from the keyboard, non unique row/column values are rejected, there is the option to get hints and (for real beginners) to highlight fields, where the number entered equals the height of the building in the application's solution (which may not be the only one, thus, non-highlighted field not necessarily contain wrong numbers).

Possible extension: Variable number of clues displayed; 2 or more difficulty levels; choice between different sets of rules.

Free Pascal features: Changing the color of edit fields during execution. Enabling/disabling controls as needed. Two-dimensional arrays (classic Pascal).


Skyscrapers - a free logic game for PC