]> git.cworth.org Git - wordgame/blobdiff - grid.c
Print board before result summary
[wordgame] / grid.c
diff --git a/grid.c b/grid.c
index 960b79626ebead506ffdc371b35375801d2a6634..5b57a51964d01d9a7286c679504d6d241cf762c0 100644 (file)
--- a/grid.c
+++ b/grid.c
@@ -45,13 +45,13 @@ typedef struct _board {
     dict_t *results;
 } board_t;
 
-int
+static int
 rand_within (int num_values)
 {
     return (int) ((double) num_values * (rand() / (RAND_MAX + 1.0)));
 }
 
-void
+static void
 shuffle (int *array, int length)
 {
     int i, r, tmp;
@@ -65,7 +65,7 @@ shuffle (int *array, int length)
     }
 }
 
-void
+static void
 board_init (board_t *board)
 {
     int i;
@@ -79,7 +79,7 @@ board_init (board_t *board)
        board->letters[i / 4][i % 4] = cube_faces[cubes[i]][rand_within(6)];
 }
 
-void
+static void
 board_print (board_t *board)
 {
     int x, y;
@@ -98,7 +98,7 @@ board_print (board_t *board)
 }
 
 #define SEEN_BIT(x, y) (1 << (4*(y)+(x)))
-void
+static void
 board_enumerate (board_t       *board,
                 int             x,
                 int             y,
@@ -229,7 +229,9 @@ main (void)
        minutes = remaining / 60;
     } while (remaining > 0);
 
-    printf ("\nWords you found:\n");
+    board_print (&board);
+
+    printf ("Words you found:\n");
     found = dict_print_by_length_if (&solution, seen_predicate);
 
     printf ("\nWords you missed:\n");