37 lines
814 B
C++
37 lines
814 B
C++
#include <catch2/catch_test_macros.hpp>
|
|
#include <fmt/core.h>
|
|
#include <string>
|
|
#include "matrix.hpp"
|
|
#include "rand.hpp"
|
|
#include "constants.hpp"
|
|
#include "maze.hpp"
|
|
|
|
using std::string;
|
|
using matrix::Matrix;
|
|
|
|
|
|
TEST_CASE("recursive division (garbage)", "[mazes]") {
|
|
auto map = matrix::make(21, 21);
|
|
std::vector<Room> rooms;
|
|
|
|
maze::recursive_div(map, rooms);
|
|
matrix::dump("MAZE?", map);
|
|
|
|
for(auto& room : rooms) {
|
|
fmt::println("room: {},{}; {},{}",
|
|
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);
|
|
}
|
|
}
|