X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=grid.c;h=273a6e83e765cb28c2ac291a17766e3ee1249b16;hb=4209ed5b071d81e28d7a9286599d33352be84c5e;hp=acfee21831118ef1f1c28df7d975639b1fcee0fb;hpb=76c92c2f9f062d3bc3cbbf57416fe6b23f1d114b;p=wordgame diff --git a/grid.c b/grid.c index acfee21..273a6e8 100644 --- a/grid.c +++ b/grid.c @@ -103,7 +103,7 @@ grid_string (grid_t *grid) else *s++ = ' '; } - if (y != 3) + if (y != (grid->size - 1)) *s++ = '\n'; } *s = '\0'; @@ -144,7 +144,10 @@ grid_enumerate (grid_t *grid, dict_cursor = dict_cursor_next (dict_cursor, 'u'); } - if (strlen (word) > 2 && + /* For the 4x4 grid any word of length 3 or more counts. + * For the 5x5 grid any word of length 4 or more counts. + */ + if (strlen (word) >= (grid->size - 1) && DICT_ENTRY_IS_WORD (dict_cursor_resolve (dict_cursor))) { dict_add_word (grid->results, word);