-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaze_solver.hpp
44 lines (34 loc) · 1.14 KB
/
maze_solver.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
// DaanyaMSA = Daanya's Maze Solver Algorithm
# ifndef DAANYAMSA_HPP
# define DAANYAMSA_HPP
# include "MazeSolver.hpp" // provided
# include "MazeSolution.hpp" // provided
# include "Maze.hpp" // provided
# include <vector>
using namespace std;
class DaanyaMSA: public MazeSolver // MazeSolver base class provided. DaanyaMSA creates maze solving algorithm.
{
public:
/** Default constructor for maze solver
*/
DaanyaMSA();
/** Returns vector of possible Directions that solution can move in
*/
vector<Direction> possibleDirections(const Maze& maze,
MazeSolution& mazeSolution);
/** Trys next move in solution
*/
void trySolve(const Maze& maze, MazeSolution& mazeSolution);
/** Handles moving solver until solution is reached
*/
void mainRecursive(const Maze& maze, MazeSolution& mazeSolution);
/** Built on mazeSolver class virtual function, initiates
solving algorithm in perfect maze
*/
void solveMaze(const Maze& maze, MazeSolution& mazeSolution);
private:
int currentCell_x;
int currentCell_y;
vector<pair<int,int>> visited;
};
# endif // DAANYAMSA_HPP