This is just a program for fun. I know it’s not optimized.
To use this program you need to create a text file with the sudoku (with 0 when there aren’t number) named sudoku1.txt
like this :
5 0 0 0 0 0 0 9 4
0 0 9 0 0 0 0 5 0
0 4 0 0 0 0 2 0 0
0 2 0 5 0 0 8 0 0
0 0 4 0 0 1 0 7 0
8 0 0 0 3 0 0 0 6
0 0 2 0 0 7 0 1 0
0 3 0 9 0 0 0 0 0
6 0 0 0 4 0 0 0 8
This text file sudoku1.txt
needs to be next to the program code.c
Then compile and execute code.c and the program will solve the sudoku on the screnn and in a file
This program use two method to solve the sudoku.
-The 1rst method is the logical one, sudoku have proprety to be solve.
But in a certain case, the sudoku can’t be solve because you need to add a number.
sudoku1.txt
fileYou can change a value to activate the log !