Now using a hunt-and-kill maze algorithm.
This commit is contained in:
parent
7a0b2f988d
commit
0f8e61797f
4 changed files with 138 additions and 10 deletions
|
@ -9,7 +9,8 @@
|
|||
using std::string;
|
||||
using matrix::Matrix;
|
||||
|
||||
TEST_CASE("simple maze first attempt", "[maze-gen]") {
|
||||
|
||||
TEST_CASE("recursive division (garbage)", "[mazes]") {
|
||||
auto map = matrix::make(21, 21);
|
||||
std::vector<Room> rooms;
|
||||
|
||||
|
@ -21,3 +22,16 @@ TEST_CASE("simple maze first attempt", "[maze-gen]") {
|
|||
room.x, room.y, room.width, room.height);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("hunt-and-kill", "[maze-gen]") {
|
||||
auto map = matrix::make(21, 21);
|
||||
std::vector<Room> rooms;
|
||||
|
||||
maze::hunt_and_kill(map, rooms);
|
||||
matrix::dump("MAZE?", map);
|
||||
|
||||
for(auto& room : rooms) {
|
||||
fmt::println("room: {},{}; {},{}",
|
||||
room.x, room.y, room.width, room.height);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue