X-Git-Url: https://git.cworth.org/git?p=wordgame;a=blobdiff_plain;f=grid.c;h=97ba7d7f3c2306e8921bf81b6e97af18d939849d;hp=960b79626ebead506ffdc371b35375801d2a6634;hb=7787438f3c3844ab9597320213f5bd19bc6426e1;hpb=6717cd95edcf1332c81daaa6c608c293dc8ffb4a diff --git a/grid.c b/grid.c index 960b796..97ba7d7 100644 --- 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,