Code by Simon Martineau. [email protected]
This repository contains a C++ program capable of solving any Sudoku puzzle from Easy to Master difficulty.
To install, follow these steps:
-
Clone the repository into your workspace:
git clone https://github.com/SimonMartineau/Sudoku_Solver.git
-
Enter the Sudoku_Solver repository
cd Sudoku_Solver
-
Create a build repository
mkdir build cd build
-
Use cmake to compile the program
cmake .. -G Ninja
-
Compile the program by using the command
ninja
-
Run the executable with the command
./SudokuSolver
If there are any issues using this method to compile the program, you can use another C++ compiler like g++
g++ main.cpp Sudoku.cpp -o SudokuSolver && ./SudokuSolver
-
To input your sudoku puzzle to solve
- Open the list_of_sudoku.txt file.
- Copy the empty puzzle filled with 0s at the top.
- Replace the existing puzzle in the main.cpp file and enter your puzzle.
- Compile the code by entering this command in the build repository.
ninja
- Launch the executable.
-
Techniques
This program uses 4 different techniques to solve sudoku puzzles.
- Obvious Singles
- Obvious Pairs
- Hidden Singles
- Hidden Pairs You get an analysis at the execution of the code of which techniques were used and how many times.
You can modify which techniques are used in the Sudoku.cpp file in the solve method.