From 5033a3054d26212a57c0cf62007708ff5fb4ecc3 Mon Sep 17 00:00:00 2001 From: Kirill Petrashin Date: Tue, 14 Apr 2026 18:39:27 +0300 Subject: Print info in walls --- path.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'path.c') diff --git a/path.c b/path.c index fd92908..a8410fc 100644 --- a/path.c +++ b/path.c @@ -348,6 +348,16 @@ void visited_free(char **visited, size_t height) { return; } +size_t visited_count(char **visited, size_t width, size_t height) { + size_t count = 0; + for (size_t row = 0; row < height; row++) { + for (size_t col = 0; col < width; col++) { + if (visited[row][col]) count++; + } + } + return count; +} + size_t **cost_so_far_new(size_t width, size_t height) { size_t **cost_so_far = malloc(sizeof(size_t*) * height); if (cost_so_far == NULL) return NULL; -- cgit v1.2.3