- CMake >= 3.10
- C++ Standard: 17 (important as std::filesystem is used)
The input and output puzzle directories and number of threads (if parallel approach is chosen) are given as command-line arguments. Input puzzles are given as .txt files, in which empty cells are indicated with '.', and empty hints are shown with '-'. See the input puzzle format in, puzzle4x4, puzzle5x5 and puzzle6x6 directories.
Use VSCode CMake extension to build, or use the following commands:
Inside the Skyscrapers directory:
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
Move back to Skyscrapers:
cd ..
./build/Skyscrapers <PUZZLES_PATH> <OUTPUT_PATH> <MODE> <#THREADS>
- PUZZLES_PATH: Relative/absolute path of input puzzle directory
- OUTPUT_PATH: Relative/absolute output path
- MODE: 1: Sequential, 2: BruteForceParallel, 3: EfficientParallel
- #THREADS: Number of threads. Only for Mode 2 or 3, omitted for Mode 1.
Example (Mode 2):
./build/Skyscrapers ./puzzle5x5 ./solutions5x5 2 10
Example (Mode 1):
./build/Skyscrapers ./puzzle5x5 ./solutions5x5 1
Solved puzzles are stored in the output directory with the suffix '_solutions.txt' with the following information:
- Solved puzzle in the same format as the input
- If the puzzle is solved or not (0: No solution, 1: Solved)
- Solution time (Given with the line "Time taken: ")