From 6675c55916c493e0e5c9f0a6108b0e6d57782c82 Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Mon, 4 Nov 2024 00:08:21 +0000 Subject: [PATCH] Draw path from exit after solving --- main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.c b/main.c index 417db2b..1ef9eeb 100644 --- a/main.c +++ b/main.c @@ -204,6 +204,13 @@ int main(void) maze[0][0].visited = true; random_walk(accessible_and_unvisited, solve_visit, solve_start); + // Draw exit path + draw_maze(); + const int x = PX(MARGIN + GRID_SIZE + 1), y = PX(MARGIN + GRID_SIZE); + XSetForeground(dpy, ctx, visited_col); + XFillRectangle(dpy, window, ctx, x, y, PX(1), PX(1)); + XFlush(dpy); + // Wait for window exit bool is_del = false; do {