diff options
| author | Kirill Petrashin <kirill8201@yandex.ru> | 2026-03-14 14:42:14 +0300 |
|---|---|---|
| committer | Kirill Petrashin <kirill8201@yandex.ru> | 2026-03-14 14:42:14 +0300 |
| commit | 528841328da0114981ee6e8c6dbdde72b64fb284 (patch) | |
| tree | e127cdab3debaa7e1a8e8b825c07ca85502681d2 /map.h | |
| parent | 365f1baabae9b2ccb3df1b4a4821bff58611f2de (diff) | |
Fix stack + implement rbt_maze_map()
Diffstat (limited to 'map.h')
| -rw-r--r-- | map.h | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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); |
