diff options
| author | Kirill Petrashin <kirill8201@yandex.ru> | 2026-05-03 13:12:25 +0300 |
|---|---|---|
| committer | Kirill Petrashin <kirill8201@yandex.ru> | 2026-05-03 13:12:25 +0300 |
| commit | 6fc30f8bb3bd345a30a36936e4008c3703aa01f0 (patch) | |
| tree | ceffbb702a4449bb79cae17c08d2c163d5defb7d /main.c | |
| parent | 702b04c89752fb16f165f5d26c99df5895c0fab4 (diff) | |
| download | astar-6fc30f8bb3bd345a30a36936e4008c3703aa01f0.tar.xz | |
Print algo name when printing time
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -269,8 +269,9 @@ int main(int argc, char **argv) { 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); path = path_func(dirs, map, cell_costs, width, height, start_pos, end_pos, visited, anim); /* TODO: print time */ @@ -383,7 +384,7 @@ int main(int argc, char **argv) { } 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_LOAD_COSTS: /* Load a cost file */ |
