]> git.cworth.org Git - wordgame/blobdiff - grid.c
Add grid5 game in addition to grid4
[wordgame] / grid.c
diff --git a/grid.c b/grid.c
index acfee21831118ef1f1c28df7d975639b1fcee0fb..273a6e83e765cb28c2ac291a17766e3ee1249b16 100644 (file)
--- 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);