/*
* Copyright © 2006 Carl Worth
*
- * This program is free software; you can redistribute it and\/or modify
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
#include "dict.h"
+#define GRID_SIZE_MAX 5
/* ( 3 chars per cell
- * x 4 cells per row
+ * x GRID_SIZE_MAX cells per row
* + 1 newline per row
- * ) x 4 rows per grid
+ * ) x GRID_SIZE_MAX rows per grid
* + 1 terminator character
- * = 53
*/
-#define GRID_STRING_MAX 53
+#define GRID_STRING_MAX (((3 * GRID_SIZE_MAX + 1) * GRID_SIZE_MAX) + 1)
typedef struct _grid {
- char letters[4][4];
+ int size;
+ char letters[GRID_SIZE_MAX][GRID_SIZE_MAX];
char string[GRID_STRING_MAX];
/* Private, transient state used by enumerate */
dict_t *results;
} grid_t;
+/* size must be 4 or 5 */
void
-grid_init (grid_t *grid);
+grid_init (grid_t *grid, int size);
+
+void
+grid_set_letters (grid_t *grid,
+ const char *letters);
char *
grid_string (grid_t *grid);