-
Notifications
You must be signed in to change notification settings - Fork 0
/
maze_generator.hpp
54 lines (39 loc) · 1.3 KB
/
maze_generator.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// DaanyaMGA = Daanya's Maze Generator Algorithm
# ifndef DAANYAMGA_HPP
# define DAANYAMGA_HPP
# include "MazeGenerator.hpp" // provided
# include "Maze.hpp" // provided
# include <random>
# include <vector>
using namespace std;
class DaanyaMGA: public MazeGenerator // MazeGenerator base class provided. DaanyaMGA creates maze gen. algorithm.
{
public:
/** Default constructor for maze generator
*/
DaanyaMGA();
/** Returns vector of possible paths given current cell and maze
*/
vector<Direction> possibleDirections(Maze& maze);
/** Handles navigating through the maze once initiated
*/
void move(Maze& maze);
/** Recursive function that forks to either keep going or cutting
off program
*/
void mainRecursive(Maze& maze);
/** Built on mazeGenerator class virtual function, initates
generation of random maze
*/
void generateMaze(Maze& maze);
private:
random_device device; // random device built into class for easy access
default_random_engine engine{device()};
uniform_int_distribution<int> distribution{1,4};
// dist 1,2,3,4 for up, right, down, left respectively
int currentCell_x;
int currentCell_y;
vector<tuple<int,int>> visited;
// vector including cell coords that have been visited already
};
# endif // DAANYAMGA_HPP