Reorganize code into library for reuse
This commit is contained in:
29
include/mazemaker.h
Normal file
29
include/mazemaker.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#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)
|
||||
Reference in New Issue
Block a user