aboutsummaryrefslogtreecommitdiff
path: root/map.c
diff options
context:
space:
mode:
authorKirill Petrashin <kirill8201@yandex.ru>2026-03-22 12:23:35 +0300
committerKirill Petrashin <kirill8201@yandex.ru>2026-03-22 12:23:35 +0300
commitd96ba29434808b94cccfcce7a675e5abbd2d846d (patch)
treef02ce36a0ec0acbc87d0a454062e6300445ad0f2 /map.c
parent348c700fedae3b0005660d8c42941fe7c69027d4 (diff)
Add ability to choose maps via args + create more maps + don't insert elements into a PPQ if there's one with better priority
Diffstat (limited to 'map.c')
-rw-r--r--map.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/map.c b/map.c
index d17c019..b0671ae 100644
--- a/map.c
+++ b/map.c
@@ -22,7 +22,7 @@ Map empty_map(size_t width, size_t height) {
return map;
}
-unsigned int neighbours(Position neighbour_array[], Position pos, size_t width, size_t height, \
+unsigned int neighbours_4dir(Position neighbour_array[], Position pos, size_t width, size_t height, \
char visited[height][width]) {
size_t cur = 0;
if (pos.x > 0 && !visited[pos.y][pos.x - 1]) {
@@ -81,7 +81,7 @@ Map rbt_maze_map(size_t width, size_t height, unsigned int seed) {
srand(seed);
do {
- int nc = neighbours(na, ps_peek(ps), width, height, visited);
+ int nc = neighbours_4dir(na, ps_peek(ps), width, height, visited);
if (nc > 0) {
Position next = na[rand() % nc];
Position prev = ps_peek(ps);