2 * Copyright © 2006 Carl Worth
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2, or (at your option)
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA."
24 #define GRID_SIZE_MAX 5
26 * x GRID_SIZE_MAX cells per row
28 * ) x GRID_SIZE_MAX rows per grid
29 * + 1 terminator character
31 #define GRID_STRING_MAX (((3 * GRID_SIZE_MAX + 1) * GRID_SIZE_MAX) + 1)
33 typedef struct _grid {
35 char letters[GRID_SIZE_MAX][GRID_SIZE_MAX];
36 char string[GRID_STRING_MAX];
38 /* Private, transient state used by enumerate */
42 /* size must be 4 or 5 */
44 grid_init (grid_t *grid, int size);
47 grid_set_letters (grid_t *grid,
51 grid_string (grid_t *grid);
54 grid_solve (grid_t *grid, dict_t *dict, dict_t *solution);