Created
December 26, 2017 17:12
-
-
Save GeorgeSeif/24e32426ab144685191818d3e1e31289 to your computer and use it in GitHub Desktop.
Sudoku Grid Setup
This file contains 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
#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