From 596eeed9dd378a8994778e03319b538206672bec Mon Sep 17 00:00:00 2001 From: Kirill Petrashin Date: Sat, 21 Mar 2026 15:31:53 +0300 Subject: Implement breadth-first-search + fix the priority queue + some other stuff --- map.h | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'map.h') diff --git a/map.h b/map.h index a4cc971..7e17479 100644 --- a/map.h +++ b/map.h @@ -3,24 +3,8 @@ #include #include "structs.h" +#include "path.h" -enum MapTile_e { - EMPTY = 0, - WALL, -}; - -typedef enum MapTile_e MapTile; - -enum Colors_e { - EMPTY_COLOR = 1, - GOAL_COLOR = 2, - WALL_COLOR = 3, - START_COLOR = 4, -}; - -/* A map is a 2D array of MapTiles. - * Use as map[row][column] */ -typedef MapTile** Map; /* Returns an empty map of given size */ Map empty_map(size_t width, size_t height); @@ -50,7 +34,10 @@ Map rbt_maze_map(size_t width, size_t height, unsigned int seed); * ..@....... */ Map file_plaintext_map(char *filename, size_t *width, size_t *height, Position *start_pos, Position *end_pos); -/* Draw the map. Bet you didn't expect that. */ -void draw_map(Map map, size_t width, size_t height, int offset_x, int offset_y, Position start, Position goal); +/* Draw the map. Bet you didn't expect that. + * path could be NULL to draw a map with no path */ +void draw_map(Map map, size_t width, size_t height, int offset_x, int offset_y, Position start, Position goal, Path path); + +void print_map_out(Map map, size_t width, size_t height); #endif /*MAP_H_ */ -- cgit v1.2.3