aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorKirill Petrashin <kirill8201@yandex.ru>2026-04-22 20:48:27 +0300
committerKirill Petrashin <kirill8201@yandex.ru>2026-04-22 20:48:27 +0300
commit55b10d144a6855791f3918f37ccdf36fd8109e58 (patch)
tree788897d35fe3eec8751a3fd4c3958941126d8709 /main.c
parent1cd0a30593d9b7805752e3e183c93f622211ed0b (diff)
downloadastar-55b10d144a6855791f3918f37ccdf36fd8109e58.tar.xz
Add a path_reverse() function
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/main.c b/main.c
index 4347551..93dfc1e 100644
--- a/main.c
+++ b/main.c
@@ -186,6 +186,8 @@ int main(int argc, char **argv) {
*
* [d] - Switch algorithms (A* or Dijsktra's)
*
+ * [r] - Reverse the path and switch start/end around
+ *
* [s] - Save the map to a bmp file
*
* [w] - Open a map from a plaintext file
@@ -276,6 +278,10 @@ int main(int argc, char **argv) {
/* TODO: print time */
break;
+ case 'r':
+ path_reverse(&path, width, height, &start_pos, &end_pos);
+ break;
+
case 'y':
case 'o':
case 'u':