If you just pick the wider of the dimensions then you get a more even spread vs random direction.

main
Zed A. Shaw 1 week ago
parent e1ebea7451
commit 5f09747109
  1. 2
      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) { void partition_map(std::mt19937 &gen, Partition &cur, int depth) {
println(">>>> DEPTH: {}", depth); println(">>>> DEPTH: {}", depth);
std::uniform_int_distribution<int> rsplit(0, 1); std::uniform_int_distribution<int> rsplit(0, 1);
bool horiz = rsplit(gen); bool horiz = cur.width > cur.height ? false : true;
int split = make_split(gen, cur, horiz); int split = make_split(gen, cur, horiz);
Partition left; Partition left;
Partition right; Partition right;

Loading…
Cancel
Save