diff options
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 12 |
1 files changed, 2 insertions, 10 deletions
@@ -122,11 +122,7 @@ int main(int argc, char **argv) { char visited[height][width]; Path path = NULL; - if (dirs == 4) { - path = breadth_first_search_path_4dir(map, width, height, start_pos, end_pos, visited, anim); - } else { - path = breadth_first_search_path_8dir(map, width, height, start_pos, end_pos, visited, anim); - } + path = breadth_first_search_path(dirs, map, width, height, start_pos, end_pos, visited, anim); while (1) { draw_map(map, width, height, offset_x, offset_y, start_pos, end_pos, NULL, path, visited, NULL); @@ -141,11 +137,7 @@ int main(int argc, char **argv) { map_free(map, height); map = rbt_maze_map(mwidth, mheight, rand()); path_free(path, height); - if (dirs == 4) { - path = breadth_first_search_path_4dir(map, width, height, start_pos, end_pos, visited, anim); - } else { - path = breadth_first_search_path_8dir(map, width, height, start_pos, end_pos, visited, anim); - } + path = breadth_first_search_path(dirs, map, width, height, start_pos, end_pos, visited, anim); } break; case 'q': map_free(map, height); path_free(path, height); endwin(); return 0; |
