diff options
| author | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-04 15:41:19 +0300 |
|---|---|---|
| committer | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-04 15:41:19 +0300 |
| commit | 04d6b474f928775ea0019928fdfbf08ecaae0997 (patch) | |
| tree | 4f1b49b7ea82f905e6abcd53b6a0a960e882bf92 /main.c | |
| parent | e2054e48107e2866f282d04aaf70cfc0fac178a3 (diff) | |
| download | astar-04d6b474f928775ea0019928fdfbf08ecaae0997.tar.xz | |
Poorly implement the map editor
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -51,6 +51,7 @@ void init_ncurses(void) { cbreak(); /* Process input one char at a time */ curs_set(0); /* Hide the cursor */ noecho(); /* Don't echo characters */ + keypad(stdscr, TRUE); initialize_colors(); } @@ -157,6 +158,7 @@ int main(int argc, char **argv) { case 'i': if(is_maze) { switch (c) { + /* TODO: handle if it's zero */ case 'y': mwidth -= 1; break; case 'o': mwidth += 1; break; case 'u': mheight += 1; break; @@ -190,6 +192,16 @@ int main(int argc, char **argv) { path = path_func(dirs, map, width, height, start_pos, end_pos, visited, anim); } break; + case 'e': + is_maze = 0; + visited_free(visited, height); + path_free(path, height); + + map_editor(&map, &width, &height, &start_pos, &end_pos); + + visited = visited_new(width, height); + path = path_func(dirs, map, width, height, start_pos, end_pos, visited, anim); + break; case 'q': map_free(map, height); path_free(path, height); endwin(); return 0; } } |
