summaryrefslogtreecommitdiff
path: root/display.c
diff options
context:
space:
mode:
authorDavid Phillips <dbphillipsnz@gmail.com>2016-03-09 00:21:35 +1300
committerDavid Phillips <david@sighup.nz>2019-03-10 21:15:30 +1300
commit6bc7fdab077b1877f71b69f4b2c1e8046a302e9b (patch)
treeba7815f0557ed9cef1056ba9c4ba81584c1650bc /display.c
downloadsudoku-6bc7fdab077b1877f71b69f4b2c1e8046a302e9b.tar.xz
Initial working copy, buggy
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");
+}