algorithm.h
Raw
1#ifndef ALGORITHM_H
2#define ALGORITHM_H
3#include <stddef.h>
4#include <game.h>
5
6//creates a game, fills it with walls and empty fields
7struct game make_maze(size_t y, size_t x);
8typedef darray(struct point) pointarr;
9
10//algorithm terminates with no path if target is not found within maxdist
11//result contains target as well as the source point
12//so even if next to the target, the result arr is at least 2 items big
13pointarr astar(struct game *g, struct point start, struct point target, size_t maxdist);
14
15
16#endif //ALGORITHM_H
17