Created
December 26, 2017 17:36
-
-
Save GeorgeSeif/d6457e742f6b09fbba90791b1e63ad57 to your computer and use it in GitHub Desktop.
Main function for the Sudoku solver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int main() | |
| { | |
| cout << "********************************\n\n\tSudoku Solver\n\n********************************" << endl << endl; | |
| int grid[DIM][DIM] = { { 0, 9, 0, 0, 0, 0, 8, 5, 3 }, | |
| { 0, 0, 0, 8, 0, 0, 0, 0, 4 }, | |
| { 0, 0, 8, 2, 0, 3, 0, 6, 9 }, | |
| { 5, 7, 4, 0, 0, 2, 0, 0, 0 }, | |
| { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, | |
| { 0, 0, 0, 9, 0, 0, 6, 3, 7 }, | |
| { 9, 4, 0, 1, 0, 8, 5, 0, 0 }, | |
| { 7, 0, 0, 0, 0, 6, 0, 0, 0 }, | |
| { 6, 8, 2, 0, 0, 0, 0, 9, 0 } }; | |
| print_grid(grid); | |
| if (true == solve_soduko(grid)) | |
| { | |
| print_grid(grid); | |
| } | |
| else | |
| { | |
| cout << "No solution exists for the given Soduko" << endl << endl; | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment