35 lines
672 B
C++
35 lines
672 B
C++
#ifndef MAZE_HPP
|
|
#define MAZE_HPP
|
|
|
|
#include <vector>
|
|
#include <unordered_map>
|
|
#include <ctime>
|
|
#include <climits>
|
|
#include <random>
|
|
|
|
const int MAZE_SIZE = 9;
|
|
const int DIRECTIONS = 4;
|
|
const int MIN_WALLS = 3;
|
|
const int MAX_WALLS = 5;
|
|
const int DEFAULT_MOVES = 10;
|
|
|
|
class Maze{
|
|
private:
|
|
std::unordered_map<int, std::vector<bool>> graph;
|
|
int moves_left;
|
|
bool is_path_exists(int, int);
|
|
|
|
struct Edge {
|
|
int node1, dir1;
|
|
int node2, dir2;
|
|
};
|
|
public:
|
|
Maze(bool);
|
|
bool test_mode;
|
|
int get_moves_left() const;
|
|
bool is_wall(int, int) const;
|
|
|
|
void set_moves_left(int);
|
|
};
|
|
#endif
|