From 5033a3054d26212a57c0cf62007708ff5fb4ecc3 Mon Sep 17 00:00:00 2001 From: Kirill Petrashin Date: Tue, 14 Apr 2026 18:39:27 +0300 Subject: Print info in walls --- main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index cac6a85..b77d554 100644 --- a/main.c +++ b/main.c @@ -16,8 +16,6 @@ /* So, TODO for now: - Allow maps to have costs - - Write out the amount of visited squares (to see how algorithms differ in - efficiency) - check ppq_insert() order - more info in anim() - save pathfinding to a series of BMPs @@ -44,6 +42,7 @@ void initialize_colors(void) { init_pair(PATH_COLOR, COLOR_YELLOW, COLOR_RED); init_pair(FRONTIER_COLOR, COLOR_BLUE, COLOR_BLUE); init_pair(CURSOR_COLOR, -1, COLOR_RED); + init_pair(WALL_TEXT_COLOR, COLOR_BLACK, COLOR_WHITE); } void init_ncurses(void) { @@ -180,8 +179,8 @@ int main(int argc, char **argv) { case 'a': anim = !anim; break; case 'd': - if (path_func == astar_path) path_func = &dijkstra_path; - else path_func = &astar_path; + if (path_func == astar_path) { set_message("Dijkstra"); path_func = &dijkstra_path; } + else { set_message("A*"); path_func = &astar_path; }; path_free(path, height); path = path_func(dirs, map, width, height, start_pos, end_pos, visited, anim); break; @@ -192,7 +191,7 @@ int main(int argc, char **argv) { case 'i': if(is_maze) { switch (c) { - case 'y': if (mwidth > 2) mwidth -= 1; break; + case 'y': if (mwidth > 5) mwidth -= 1; break; case 'o': mwidth += 1; break; case 'u': mheight += 1; break; case 'i': if (mheight > 2) mheight -= 1; break; -- cgit v1.2.3