I can validate that a map is pathable, but can't fix it.

This commit is contained in:
Zed A. Shaw 2026-03-10 00:42:58 -04:00
parent 74f92dfe2c
commit 8090251a71
7 changed files with 116 additions and 21 deletions

View file

@ -28,8 +28,8 @@ TEST_CASE("hunt-and-kill", "[mazes]") {
}
TEST_CASE("hunt-and-kill box", "[mazes]") {
for(int i = 5; i < 100; i++) {
Map map((i / 2) + 20, (i / 2) + 20);
for(int i = 25; i < 65; i += 2) {
Map map(i, i);
maze::Builder maze(map);
maze.hunt_and_kill();
@ -83,8 +83,8 @@ TEST_CASE("hunt-and-kill no-dead-ends", "[mazes]") {
}
TEST_CASE("hunt-and-kill too much", "[mazes]") {
for(int i = 5; i < 100; i++) {
Map map((i / 2) + 20, (i / 2) + 20);
for(int i = 25; i < 65; i += 2) {
Map map(i, i);
maze::Builder maze(map);
maze.hunt_and_kill();
@ -100,3 +100,23 @@ TEST_CASE("hunt-and-kill too much", "[mazes]") {
}
}
}
TEST_CASE("hunt-and-kill validator", "[mazes]") {
Map map(33, 33);
maze::Builder maze(map);
maze.hunt_and_kill();
maze.clear();
maze.inner_box(6, 4);
maze.randomize_rooms(ROOM_SIZE);
maze.hunt_and_kill();
maze.open_box(6);
maze.make_doors();
maze.enclose();
bool valid = maze.validate();
maze.dump("VALIDATED");
REQUIRE(valid == true);
}