Pause for longer while solving

This commit is contained in:
Camden Dixie O'Brien 2024-11-04 20:44:20 +00:00
parent ebbaac7db9
commit bb44747770

7
main.c
View File

@ -39,7 +39,8 @@ typedef struct {
bool visited : 1;
} cell_t;
static const struct timespec wait = { .tv_nsec = 5000000 };
static const struct timespec gen_pause = { .tv_nsec = 5000000 };
static const struct timespec solve_pause = { .tv_nsec = 10000000 };
static const vec2_t steps[] = {
[LEFT] = { .x = -2, .y = 0 },
@ -115,7 +116,7 @@ static bool generation_visit(vec2_t c, vec2_t im)
maze[im.x][im.y].is_path = true;
clear_path(im);
clear_path(c);
nanosleep(&wait, NULL);
nanosleep(&gen_pause, NULL);
return false;
}
@ -130,7 +131,7 @@ static bool solve_visit(vec2_t c, vec2_t im)
maze[im.x][im.y].visited = true;
draw_visited(im);
draw_visited(c);
nanosleep(&wait, NULL);
nanosleep(&solve_pause, NULL);
return GOAL == c.x && GOAL == c.y;
}