-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
40 lines (33 loc) · 908 Bytes
/
Copy pathmain.cpp
File metadata and controls
40 lines (33 loc) · 908 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
#include <iostream>
#include "BitBoard.h"
#include <bitset>
using namespace std;
int test_depthtwo_movecount();
int main() {
//Tests only
int success = test_depthtwo_movecount();
if (success != 0) {
cout << "Test fail" << endl;
return -1;
}
return 0;
}
int test_depthtwo_movecount() {
/**
* Checks that the number of legal positions is 400 after two moves
* returns 0 if this works
*/
BitBoard s;
int movecount_depthtwo, len;
movecount_depthtwo = 0;
BitBoard* depthone = s.getLegalBoards(0, &len);
for (int i = 0; i < len; i++) {
int leafdepth;
BitBoard* leaf = depthone[i].getLegalBoards(1, &leafdepth);
movecount_depthtwo += leafdepth;
delete[] leaf;
}
delete[] depthone;
cout << "Depth 2 move count: " << movecount_depthtwo << endl;
return movecount_depthtwo - 400;
}