forked from conanwu777/rubik
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSolver.hpp
More file actions
41 lines (36 loc) · 859 Bytes
/
Solver.hpp
File metadata and controls
41 lines (36 loc) · 859 Bytes
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
#ifndef SOLVER_HPP
# define SOLVER_HPP
# include "rubik.hpp"
# include "Cube.hpp"
# include <iomanip>
# include <unistd.h>
# include <queue>
# include <unordered_set>
# include <chrono>
# define PTR std::shared_ptr<Cube>
# define MPTR(y) std::make_shared<Cube>(y)
class Solver
{
public:
bool allowedMoves[18];
unordered_set<int> middleSlice = {fr, fl, bl, br};
int64_t phaseGoal[5];
unordered_set<int64_t> ids;
int64_t (Solver::*idPhase[4])(Cube) = {
&Solver::idPhase1,
&Solver::idPhase2,
&Solver::idPhase3,
&Solver::idPhase4
};
int64_t idPhase1(Cube c);
int64_t idPhase2(Cube c);
int64_t idPhase3(Cube c);
int64_t idPhase4(Cube c);
Cube BFS(int step, queue<Cube>);
int64_t getPhaseId(Cube c, int phase);
void nextPhase();
Solver(Cube c);
// void readData(std::string file);
void printBoard(PTR b);
};
#endif