-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.cxx
65 lines (56 loc) · 1.54 KB
/
Main.cxx
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
#include <iostream>
#include <Board.h>
int main(int argc, char* argv)
{
int easyBoard[81] = {
0, 0, 0, 7, 0, 0, 0, 9, 0,
0, 0, 9, 0, 3, 0, 0, 6, 0,
8, 0, 0, 6, 0, 0, 4, 3, 2,
7, 0, 0, 0, 0, 3, 6, 0, 0,
0, 2, 0, 0, 7, 0, 0, 5, 0,
0, 0, 8, 5, 0, 0, 0, 0, 7,
9, 8, 1, 0, 0, 7, 0, 0, 6,
0, 4, 0, 0, 9, 0, 2, 0, 0,
0, 6, 0, 0, 0, 5, 0, 0, 0
};
int hardBoard[81] = {
3, 0, 0, 0, 1, 4, 0, 6, 0,
0, 0, 8, 0, 0, 0, 1, 0, 0,
9, 6, 0, 0, 0, 0, 0, 0, 8,
0, 2, 4, 1, 0, 6, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 5, 0, 8, 3, 4, 0,
4, 0, 0, 0, 0, 0, 0, 3, 1,
0, 0, 6, 0, 0, 0, 2, 0, 0,
0, 3, 0, 4, 5, 0, 0, 0, 7
};
int hardBoard2[81] = {
0, 0, 0, 8, 4, 0, 0, 0, 9,
0, 0, 1, 0, 0, 0, 0, 0, 5,
8, 0, 0, 0, 2, 1, 4, 6, 0,
7, 0, 8, 0, 0, 0, 0, 9, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 5, 0, 0, 0, 0, 3, 0, 1,
0, 2, 4, 9, 1, 0, 0, 0, 7,
9, 0, 0, 0, 0, 0, 5, 0, 0,
3, 0, 0, 0, 8, 4, 0, 0, 0
};
int hardBoard3[81] = {
0, 0, 0, 0, 1, 0, 4, 0, 0,
0, 2, 0, 6, 0, 0, 0, 0, 5,
3, 9, 0, 0, 0, 7, 0, 0, 1,
5, 0, 0, 0, 6, 0, 0, 3, 0,
0, 6, 0, 0, 0, 0, 0, 8, 0,
0, 3, 0, 0, 8, 0, 0, 0, 7,
9, 0, 0, 2, 0, 0, 0, 5, 6,
4, 0, 0, 0, 0, 5, 0, 2, 0,
0, 0, 2, 0, 3, 0, 0, 0, 0
};
Board board(hardBoard3);
std::cout << "Initial board." << std::endl;
board.Print();
bool solvable = board.Solve();
std::cout << "Is solvable: " << (solvable ? "true" : "false") << std::endl;
std::cout << "After solving." << std::endl;
board.Print();
}