This algorithm solves sudoku 9x9. It was written in C++ using class Sudoku
which is core of algorithm. Tested on 1 case: 100% correct.
To compile you need C++ compiler supports standard 17 and CMake compatible version 3.5. Commands to run:
mkdir build
cmake -S . -B build
cmake --build build
Just find executable and run. On Windows that file name will be ended with .exe
. If you want to run other examples just edit file main.cpp
or link sudoku.h
and sudoku.cpp
to your project.
Example:
#include "sudoku.h"
#include <iostream>
int main(){
int** data;
//Load here your data to 2 dimensional dynamic integer array
Sudoku s();
s.loadFromIntMatrix(data);
std::cout << s.fullSolve() << "\n" << s.getDisplayString();
return 0;
}
- Issues If you find any bug or have any idea how to improve it, make issue. I will think about it and maybe I will do it
- Pull Request if you have already working code and you want to share it, I will accept it
Full license click here