Skip to content

Instantly share code, notes, and snippets.

@GeorgeSeif
Created December 26, 2017 17:12
Show Gist options
  • Save GeorgeSeif/24e32426ab144685191818d3e1e31289 to your computer and use it in GitHub Desktop.
Save GeorgeSeif/24e32426ab144685191818d3e1e31289 to your computer and use it in GitHub Desktop.
Sudoku Grid Setup
#define DIM 9
#define BLANK 0
#define SPACE " "
#define LINE "|"
#define NEW_ROW "-------------------------------------"
#define GRID_FULL std::make_pair(9, 9)
// Prints the Soduko grid
void print_grid(int grid[DIM][DIM])
{
for (int i = 0; i < DIM; i++)
{
cout << SPACE << SPACE << SPACE << SPACE << endl;
cout << NEW_ROW << endl;
for (int j = 0; j < DIM; j++)
{
cout << SPACE;
if (BLANK == grid[i][j])
{
cout << SPACE;
}
else
{
cout << grid[i][j];
}
cout << SPACE;
cout << LINE;
}
}
cout << endl << NEW_ROW << endl << endl;;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment