|
@@ -1,16 +1,30 @@
|
|
|
#include <stdio.h>
|
|
|
-
|
|
|
-void main() {
|
|
|
- char display[2][3] = {
|
|
|
- {'_','_'},
|
|
|
- {'|','|','|'}
|
|
|
- };
|
|
|
-
|
|
|
- int i, j;
|
|
|
- for (i = 0; i < 2; i++) {
|
|
|
- for (j = 0; j > 3; j++) {
|
|
|
- printf("%d ", display[i][j]);
|
|
|
- }
|
|
|
+
|
|
|
+#define GRID_SIZE 9
|
|
|
+
|
|
|
+void initGrid(char grid[][GRID_SIZE]);
|
|
|
+void printGrid(char grid[][GRID_SIZE]);
|
|
|
+
|
|
|
+int main(void) {
|
|
|
+ char grid[GRID_SIZE][GRID_SIZE];
|
|
|
+
|
|
|
+ initGrid(grid);
|
|
|
+ printGrid(grid);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+void initGrid(char grid[][GRID_SIZE]) {
|
|
|
+ for (int x = 0; x < GRID_SIZE; x++)
|
|
|
+ for (int y = 0; y < GRID_SIZE; y++)
|
|
|
+ grid[x][y] = ' ';
|
|
|
+ // or memset(grid, ' ', GRID_SIZE * GRID_SIZE);
|
|
|
+}
|
|
|
+
|
|
|
+void printGrid(char grid[][GRID_SIZE]) {
|
|
|
+ for (int x = 0; x < GRID_SIZE; x++) {
|
|
|
+ for (int y = 0; y < GRID_SIZE; y++)
|
|
|
+ printf("[%c]", grid[x][y]);
|
|
|
+ printf("\n");
|
|
|
}
|
|
|
-
|
|
|
}
|