summaryrefslogtreecommitdiff
path: root/display.c
diff options
context:
space:
mode:
Diffstat (limited to 'display.c')
-rw-r--r--display.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/display.c b/display.c
new file mode 100644
index 0000000..f147570
--- /dev/null
+++ b/display.c
@@ -0,0 +1,26 @@
+#include "cell.h"
+
+#include <stdio.h>
+
+void display(struct cell board[9][9])
+{
+ int x;
+ int y;
+ int val;
+ for (y = 0; y < 9; y++)
+ {
+ if (y % 3 == 0 && y != 0)
+ printf("------+------+------\n");
+ for (x = 0; x < 9; x++)
+ {
+ if (x % 3 == 0 && x != 0)
+ printf("|");
+
+ val = board[x][y].val;
+
+ printf("%c ", val == 0? ' ' : val+'0');
+ }
+ printf("\n");
+ }
+ printf("\n");
+}