aboutsummaryrefslogtreecommitdiff
path: root/map.h
diff options
context:
space:
mode:
authorKirill Petrashin <kirill8201@yandex.ru>2026-03-14 14:42:14 +0300
committerKirill Petrashin <kirill8201@yandex.ru>2026-03-14 14:42:14 +0300
commit528841328da0114981ee6e8c6dbdde72b64fb284 (patch)
treee127cdab3debaa7e1a8e8b825c07ca85502681d2 /map.h
parent365f1baabae9b2ccb3df1b4a4821bff58611f2de (diff)
Fix stack + implement rbt_maze_map()
Diffstat (limited to 'map.h')
-rw-r--r--map.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/map.h b/map.h
index aa40652..9c4a4fa 100644
--- a/map.h
+++ b/map.h
@@ -26,10 +26,14 @@ typedef MapTile** Map;
// Returns an empty map of given size
Map empty_map(size_t width, size_t height);
+// Stores all the existing neighbours of pos in neighbour_array and returns their amount
+unsigned int neighbours(Position neighbour_array[], Position pos, size_t width, size_t height, \
+ char visited[height][width]);
+
// https://en.wikipedia.org/wiki/Maze_generation_algorithm#Randomized_depth-first_search
// WARNING: width and height are not the width and height of the returned map!
// TODO: formula for actual size
-Map rbt_maze_map(size_t width, size_t height);
+Map rbt_maze_map(size_t width, size_t height, unsigned int seed);
// Draw the map. Bet you didn't expect that.
void draw_map(Map map, int width, int height, Position player_pos);