From 528841328da0114981ee6e8c6dbdde72b64fb284 Mon Sep 17 00:00:00 2001 From: Kirill Petrashin Date: Sat, 14 Mar 2026 14:42:14 +0300 Subject: Fix stack + implement rbt_maze_map() --- map.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'map.h') 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); -- cgit v1.2.3