-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSetUp.h
71 lines (64 loc) · 2.1 KB
/
SetUp.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef SETUP_H_INCLUDED
#define SETUP_H_INCLUDED
#include <iostream>
#include <fstream>
#include <vector>
#include <list>
#include <string>
class Soduko
{
private:
struct usedValues
{
std::vector<int> rowValues;
std::vector<int> colValues;
usedValues();
};
struct blockValues
{
std::vector<int> values;
int idx;
int idy;
int realValue;
blockValues();
};
struct Matrix
{
int matrix[9][9] = {};
Matrix();
bool getMatrix();
bool getMatrix(std::ofstream& outFile);
int getSpecific(int, int);
int getTotalValue();
bool setMatrix(int, int, int);
bool setSpecific(int, int, int);
std::string getMatrixString();
};
usedValues listOfPossbilities[9];
blockValues listOfValues[81];
//int Matrix[9][9] = {};
public:
Soduko();
//bool getMatrix();
bool getPossiblities();
bool generateBlock(Matrix& currentMatrix);
bool getBlock();
bool InputMatrix(Matrix& currentMatrix);
bool CopyMatrix(Matrix& lhs, Matrix rhs);
bool CopyBlockValues(blockValues& lhs, blockValues rhs);
bool CompareMatrix(Matrix lhs, Matrix rhs);
bool FindEasyStates(Matrix& currentMatrix);
bool StartGuessing(std::list<Matrix>& listOfMatrices);
bool SmartGuessing(std::list<Matrix>& listOfMatrices);
bool InitPossibilities(Matrix& currentMatrix);
bool UpDate(Matrix& currentMatrix);
bool CheckIfEnd(Matrix currentMatrix);
bool CheckIfZero(Matrix currentMatrix);
bool CheckIfReal(Matrix currentMatrix, int);
int ReturnCurrentX(int, int);
bool NaiveControl(std::list<Matrix>& listOfMatrices);
bool SmartControl(std::list<Matrix>& listOfMatrices);
bool SortArray();
int Control();
};
#endif // SETUP_H_INCLUDED