-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChessMain.cpp
162 lines (127 loc) · 5.48 KB
/
ChessMain.cpp
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#include"ChessBoard.h"
#include"Pieces.h"
#include<iostream>
using std::cout;
int main() {
cout << "========================\n";
cout << "Testing the Chess Engine\n";
cout << "========================\n\n";
ChessBoard cb;
cb.loadState("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq");
cout << '\n';
cb.submitMove("D7", "D6");
cout << '\n';
cb.submitMove("D4", "H6");
cout << '\n';
cb.submitMove("D2", "D4");
cout << '\n';
cb.submitMove("F8", "B4");
cout << '\n';
cout << "=========================\n";
cout << "Alekhine vs. Vasic (1931)\n";
cout << "=========================\n\n";
cb.loadState("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq");
cout << '\n';
cb.submitMove("E2", "E4");
cb.submitMove("E7", "E6");
cout << '\n';
cb.submitMove("D2", "D4");
cb.submitMove("D7", "D5");
cout << '\n';
cb.submitMove("B1", "C3");
cb.submitMove("F8", "B4");
cout << '\n';
cb.submitMove("F1", "D3");
cb.submitMove("B4", "C3");
cout << '\n';
cb.submitMove("B2", "C3");
cb.submitMove("H7", "H6");
cout << '\n';
cb.submitMove("C1", "A3");
cb.submitMove("B8", "D7");
cout << '\n';
cb.submitMove("D1", "E2");
cb.submitMove("D5", "E4");
cout << '\n';
cb.submitMove("D3", "E4");
cb.submitMove("G8", "F6");
cout << '\n';
cb.submitMove("E4", "D3");
cb.submitMove("B7", "B6");
cout << '\n';
cb.submitMove("E2", "E6");
cb.submitMove("F7", "E6");
cout << '\n';
cb.submitMove("D3", "G6");
cout << '\n';
cout << "=========================\n";
cout << "Potekmin vs. Alekhine (1912)\n";
cout << "=========================\n\n";
cb.loadState("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq");
cout << '\n';
cb.submitMove("E2", "E4"); cb.submitMove("C7", "C5");
cb.submitMove("G2", "G3"); cb.submitMove("G7", "G6");
cb.submitMove("F1", "G2"); cb.submitMove("F8", "G7");
cb.submitMove("G1", "E2"); cb.submitMove("B8", "C6");
cb.submitMove("C2", "C3"); cb.submitMove("G8", "F6");
cb.submitMove("B1", "A3"); cb.submitMove("D7", "D5");
cb.submitMove("E4", "D5"); cb.submitMove("F6", "D5");
cb.submitMove("A3", "C2"); cb.submitMove("E8", "G8");
cb.submitMove("D2", "D4"); cb.submitMove("C5", "D4");
cb.submitMove("C3", "D4"); cb.submitMove("C8", "G4");
cb.submitMove("F2", "F3"); cb.submitMove("G4", "F5");
cb.submitMove("C2", "E3"); cb.submitMove("D8", "A5");
cb.submitMove("E1", "F2"); cb.submitMove("D5", "B4");
cb.submitMove("E3", "F5"); cb.submitMove("A5", "F5");
cb.submitMove("G3", "G4"); cb.submitMove("B4", "D3");
cb.submitMove("F2", "G3"); cb.submitMove("C6", "D4");
cb.submitMove("G4", "F5"); cb.submitMove("D4", "F5");
cb.submitMove("G3", "G4"); cb.submitMove("H7", "H5");
cb.submitMove("G4", "H3"); cb.submitMove("D3", "F2");
cout << "=========================\n";
cout << "Stalemate game\n";
cout << "=========================\n\n";
cb.loadState("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq");
cout << '\n';
cb.submitMove("D2", "D4"); cb.submitMove("G8", "F6"); cout << "\n";
cb.submitMove("C2", "C4"); cb.submitMove("E7", "E6"); cout << "\n";
cb.submitMove("G2", "G3"); cb.submitMove("F8", "B4"); cout << "\n";
cb.submitMove("C1", "D2"); cb.submitMove("D8", "E7"); cout << "\n";
cb.submitMove("F1", "G2"); cb.submitMove("B4", "D2"); cout << "\n";
cb.submitMove("D1", "D2"); cb.submitMove("D7", "D6"); cout << "\n";
cb.submitMove("B1", "C3"); cb.submitMove("E8", "G8"); cout << "\n";
cb.submitMove("G1", "F3"); cb.submitMove("E6", "E5"); cout << "\n";
cb.submitMove("E1", "G1"); cb.submitMove("F8", "E8"); cout << "\n";
cb.submitMove("E2", "E4"); cb.submitMove("C8", "G4"); cout << "\n";
cb.submitMove("D4", "D5"); cb.submitMove("G4", "F3"); cout << "\n";
cb.submitMove("G2", "F3"); cb.submitMove("B8", "D7"); cout << "\n";
cb.submitMove("B2", "B4"); cb.submitMove("A7", "A5"); cout << "\n";
cb.submitMove("A2", "A3"); cb.submitMove("A8", "A6"); cout << "\n";
cb.submitMove("C3", "B5"); cb.submitMove("D7", "B6"); cout << "\n";
cb.submitMove("A1", "C1"); cb.submitMove("A5", "B4"); cout << "\n";
cb.submitMove("A3", "B4"); cb.submitMove("E7", "D7"); cout << "\n";
cb.submitMove("D2", "D3"); cb.submitMove("A6", "A4"); cout << "\n";
cb.submitMove("D3", "B3"); cb.submitMove("E8", "A8"); cout << "\n";
cb.submitMove("F1", "D1"); cb.submitMove("H7", "H5"); cout << "\n";
cb.submitMove("H2", "H4"); cb.submitMove("G7", "G6"); cout << "\n";
cb.submitMove("C1", "B1"); cb.submitMove("F6", "G4"); cout << "\n";
cb.submitMove("F3", "E2"); cb.submitMove("D7", "E7"); cout << "\n";
cb.submitMove("B1", "C1"); cb.submitMove("C7", "C6"); cout << "\n";
cb.submitMove("D5", "C6"); cb.submitMove("B7", "C6"); cout << "\n";
cb.submitMove("C4", "C5"); cb.submitMove("D6", "C5"); cout << "\n";
cb.submitMove("B4", "C5"); cb.submitMove("B6", "D7"); cout << "\n";
cb.submitMove("B5", "D6"); cb.submitMove("D7", "F6"); cout << "\n";
cb.submitMove("E2", "C4"); cb.submitMove("G4", "F2"); cout << "\n";
cb.submitMove("G1", "F2"); cb.submitMove("A4", "A3"); cout << "\n";
cb.submitMove("C4", "F7"); cb.submitMove("G8", "G7"); cout << "\n";
cb.submitMove("B3", "E6"); cb.submitMove("A3", "A2"); cout << "\n";
cb.submitMove("F2", "G1"); cb.submitMove("A8", "A3"); cout << "\n";
cb.submitMove("D6", "E8"); cb.submitMove("G7", "H6"); cout << "\n";
cb.submitMove("E8", "F6"); cb.submitMove("A3", "G3"); cout << "\n";
cb.submitMove("G1", "H1"); cb.submitMove("E7", "F7"); cout << "\n";
cb.submitMove("D1", "D7"); cb.submitMove("F7", "F6"); cout << "\n";
cb.submitMove("E6", "F6"); cb.submitMove("A2", "H2"); cout << "\n";
cb.submitMove("H1", "H2"); cb.submitMove("G3", "H3"); cout << "\n";
cb.submitMove("H2", "H3");
return 0;
}