From 6fc30f8bb3bd345a30a36936e4008c3703aa01f0 Mon Sep 17 00:00:00 2001 From: Kirill Petrashin Date: Sun, 3 May 2026 13:12:25 +0300 Subject: Print algo name when printing time --- map.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'map.c') diff --git a/map.c b/map.c index 28a87ea..a5e528c 100644 --- a/map.c +++ b/map.c @@ -727,8 +727,9 @@ void map_editor(Map *map, size_t *width, size_t *height, Position *start, Positi break; case KEYBINDING_ALGO: - if (path_func == astar_path) { set_message("Dijkstra's"); path_func = &dijkstra_path; } - else { set_message("A*"); path_func = &astar_path; }; + if (path_func == astar_path) { path_func_string = DIJKSTRA_STRING; path_func = &dijkstra_path; } + else { path_func_string = ASTAR_STRING; path_func = &astar_path; }; + set_message("%s", path_func_string); path_free(path, *height); if (should_pathfind) path = path_func(dirs, *map, NULL, *width, *height, *start, *goal, visited, 0); @@ -769,7 +770,7 @@ void map_editor(Map *map, size_t *width, size_t *height, Position *start, Positi break; case KEYBINDING_PATH_TIME: - set_message("%f seconds", path_time); print_message(*height); + set_message("%f seconds (%s)", path_time, path_func_string); print_message(*height); break; case KEYBINDING_SAVE_MAP: -- cgit v1.2.3