diff options
| author | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-14 18:39:27 +0300 |
|---|---|---|
| committer | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-14 18:39:27 +0300 |
| commit | 5033a3054d26212a57c0cf62007708ff5fb4ecc3 (patch) | |
| tree | 5eacb67f55596ee9718cd09373628333cbaecf14 /path.c | |
| parent | f0b6bb6974c823c4b5a7deffce0748f2ff6370de (diff) | |
| download | astar-5033a3054d26212a57c0cf62007708ff5fb4ecc3.tar.xz | |
Print info in walls
Diffstat (limited to 'path.c')
| -rw-r--r-- | path.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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; |
