aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/main.c b/main.c
index 317a237..c35afdd 100644
--- a/main.c
+++ b/main.c
@@ -56,7 +56,7 @@ int main(int argc, char **argv) {
Position start_pos, end_pos;
size_t width, height;
Map map = NULL;
- Path (*path_func)(int, Map, size_t, size_t, Position, Position, char **, char) = &dijkstra_path;
+ Path (*path_func)(int, Map, size_t, size_t, Position, Position, char **, char) = &astar_path;
size_t mwidth = 20; /* Maze width */
size_t mheight = 10; /* Maze height */
@@ -72,6 +72,7 @@ int main(int argc, char **argv) {
/* Handle args.
* Currently supported:
* -a to animate the pathfinding (get input after each step)
+ * -d for Dijkstra
* -m {width}x{height} to give a maze of given size
* -f {filename} to load a map from the filename
* -b {filename} to just generate a bitmap, no interface
@@ -80,9 +81,10 @@ int main(int argc, char **argv) {
/* TODO: Argument to choose the algorithm */
/* TODO: Argument to set seed */
int opt;
- while ((opt = getopt(argc, argv, ":am:f:b:48")) != -1) {
+ while ((opt = getopt(argc, argv, ":adm:f:b:48")) != -1) {
switch (opt) {
case 'a': anim = 1; break;
+ case 'd': path_func = &dijkstra_path; break;
case 'm':
if (sscanf(optarg, "%zux%zu", &mwidth, &mheight) != 2) error("Wrong maze size string in argument\n");
is_maze = 1;