From 5f09747109b963745c35bb589dcd4a7b8097917b Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Sat, 28 Sep 2024 04:01:29 -0400 Subject: [PATCH] If you just pick the wider of the dimensions then you get a more even spread vs random direction. --- map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/map.cpp b/map.cpp index 9b8bf87..75c032d 100644 --- a/map.cpp +++ b/map.cpp @@ -130,7 +130,7 @@ inline int make_split(std::mt19937 &gen, Partition &cur, bool horiz) { void partition_map(std::mt19937 &gen, Partition &cur, int depth) { println(">>>> DEPTH: {}", depth); std::uniform_int_distribution rsplit(0, 1); - bool horiz = rsplit(gen); + bool horiz = cur.width > cur.height ? false : true; int split = make_split(gen, cur, horiz); Partition left; Partition right;