30 lines
572 B
C
30 lines
572 B
C
#ifndef _MAZEMAKER_H
|
|
#define _MAZEMAKER_H 1
|
|
|
|
#include <stdlib.h>
|
|
#include <stdint.h>
|
|
|
|
typedef uint8_t edgeweight_t;
|
|
|
|
typedef struct {
|
|
edgeweight_t up, right;
|
|
} mazeedges_t;
|
|
|
|
typedef struct {
|
|
size_t width, height;
|
|
mazeedges_t** grid;
|
|
} mazegrid_t;
|
|
|
|
typedef enum {
|
|
EDGE_UP,
|
|
EDGE_RIGHT,
|
|
EDGE_DOWN,
|
|
EDGE_LEFT
|
|
} mazeedge_dir_t;
|
|
|
|
void mazemaker_generate_maze(int width, int height, mazegrid_t* result);
|
|
void mazemaker_free_maze(mazegrid_t* maze);
|
|
int mazemaker_maze_to_png(mazegrid_t const* maze, char const* filename);
|
|
|
|
#endif // !def(_MAZEMAKER_H)
|