diff options
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; |
