A sudoku solver program, written in C++, using OpenMP.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
The basic requirements for building the executable are:
- CMake 2.8+
- a c++ compiler
- make
sudo apt-get install build-essentials cmake
This program have been tested on Ubuntu 16.04 but should work under any systems that fulfills the aforementioned requirements.
If you succesfully cloned the source files and you are currently in the project directory, you can generate the Makefile using the following command:
mkdir build
cd build/
cmake ..
Now you can build the binary by running:
make
Now, you should see the executable in the build file.
The program has three main functionalities:
- generate all possible 2x2 sudokus and solve them
./sudoku 2
- generate a 3x3 sudoku with custom difficulty
./sudoku 3 generate easy
or
./sudoku 3 generate medium
or
./sudoku 3 generate hard
The generated sudoku will be in the output.txt file.
- solve sudoku from file - you have to provide the filename and "single_sol" if you are not interested if the sudoku has more than one solutions:
./sudoku 3 sudoku_easy.txt single_sol
This will solve the sudoku provided in sudoku_easy.txt and retrieve it in output.txt. If you want to know if a sudoku has a single solution or multiple, you can check it if you provide multi_sol intead of single_sol:
./sudoku 3 sudoku_manysolutions.txt multi_sol
This will still retrieve only one solution in output.txt, but it will inform you about sudokus with multiple solutions.
- OpenMP - used for creating multiple threads for the tasks (pixel color calculation)
- Biró Enikő - BiroEniko