Skip to content

Instantly share code, notes, and snippets.

@GeorgeSeif
Created December 26, 2017 17:36
Show Gist options
  • Select an option

  • Save GeorgeSeif/d6457e742f6b09fbba90791b1e63ad57 to your computer and use it in GitHub Desktop.

Select an option

Save GeorgeSeif/d6457e742f6b09fbba90791b1e63ad57 to your computer and use it in GitHub Desktop.
Main function for the Sudoku solver
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