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;
}
}
-void
+static void
board_init (board_t *board)
{
int i;
board->letters[i / 4][i % 4] = cube_faces[cubes[i]][rand_within(6)];
}
-void
+static void
board_print (board_t *board)
{
int x, y;
}
#define SEEN_BIT(x, y) (1 << (4*(y)+(x)))
-void
+static void
board_enumerate (board_t *board,
int x,
int y,
sprintf (prompt, "%02d:%02d ", minutes, seconds);
response = readline (prompt);
add_history (response);
- chomp (response);
if (strlen (response) == 0) {
board_print (&board);
} else {
dict_entry_t *entry;
+ if (response[strlen (response) - 1] == '\n')
+ response[strlen (response) - 1] = '\0';
entry = dict_lookup (&solution, response);
if (DICT_ENTRY_IS_WORD (entry)) {
if (*entry & GRID_WORD_SEEN)