-
Notifications
You must be signed in to change notification settings - Fork 1
/
Solver.h
38 lines (27 loc) · 831 Bytes
/
Solver.h
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
class Solver {
protected:
static void (*drawNumCallback)(int id, int number);
Square squares[MAX*MAX];
Set sets[MAX*3];
std::vector<std::vector<int>> numberCombos;
bool update;
float max;
bool easyMode;
// Algorithms
bool SinglePossibilityInSquare();
bool SinglePossibilityInSet();
bool SubgroupExclusion();
bool NakedSets();
bool HiddenSets();
bool HiddenAndNakedTwinExclusion();
bool XWingAndSwordfish();
// Algorithm helpers
bool FindNakedSetRecursive(Set *set, vector<int>* used_numbers, Set* used_squares, Square* square);
int GetSquareIdFromRegion(int id, int squarenum);
public:
Solver();
void SetCallbacks(void(*drawNumCallback)(int id, int number), void(*onBlockCallback)(int id, int number));
void UpdateBoard(vector<int>* board);
bool BoardHasDuplicates();
void Solve(bool easyMode);
};