Files
wordsearch/src/grid.h

27 lines
696 B
C
Raw Normal View History

2017-01-03 19:13:13 +00:00
#ifndef WORDSEARCH_GRID
#define WORDSEARCH_GRID
#define WORDSEARCH_MAXTRIES 500
2017-01-07 12:42:18 +00:00
char **make_grid(char **words, int height, int width, int simple, int count);
2017-01-03 19:13:13 +00:00
typedef struct bounds {
2017-01-07 12:42:18 +00:00
int min_y;
int max_y;
int min_x;
int max_x;
2017-01-03 19:13:13 +00:00
} bounds;
/* returns NULL if cannot fit word; caller needs to free() the response */
2017-01-07 12:42:18 +00:00
bounds *get_bounds(int height, int width, enum direction direction, int length);
2017-01-03 19:13:13 +00:00
2017-01-07 12:42:18 +00:00
int place_word(char *word, char **grid, int height, int width, int simple);
char **init_grid(char** old, int height, int width);
void free_grid(char** grid, int height);
int move_x(int x, enum direction d);
int move_y(int y, enum direction d);
2017-03-18 08:09:19 +00:00
void print_grid(char** grid, int height);
2017-01-07 12:42:18 +00:00
#endif