Add API function to solve maze

This commit is contained in:
2022-01-18 14:11:02 -05:00
parent 05d5cf3d79
commit 5169b4223a
3 changed files with 121 additions and 18 deletions

View File

@@ -22,6 +22,15 @@ typedef enum {
EDGE_LEFT
} mazeedge_dir_t;
typedef struct {
size_t x, y;
} maze_point_t;
typedef struct {
size_t length;
maze_point_t* nodes;
} maze_path_t;
typedef struct mazeoptions mazeoptions_t;
void mazemaker_generate_maze(int width, int height, mazegrid_t* result);
@@ -38,4 +47,7 @@ int mazemaker_options_set_wall_color(mazeoptions_t*, char const* color_desc);
int mazemaker_options_set_background_color(mazeoptions_t*, char const* color_desc);
void mazemaker_options_set_seed(mazeoptions_t*, unsigned int seed);
int mazemaker_solve(mazegrid_t const* maze, maze_path_t* path);
void mazemaker_path_free(maze_path_t* path);
#endif // !def(_MAZEMAKER_H)