-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.cpp
58 lines (40 loc) · 1.4 KB
/
test.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
#include <chrono>
#include <cstdlib>
#include <iostream>
#include <bitset>
#include "src/Board.hpp"
#include "src/Constants.hpp"
#include "src/Engine.hpp"
#include "src/Evaluation.hpp"
#include "src/Misc.hpp"
#include "src/Move.hpp"
#include "src/MoveGenerator.hpp"
#include "src/PositionMath.hpp"
#include "src/SortedMoveGenerator.hpp"
using namespace std::chrono;
int main() {
Board::initialize();
SortedMoveGenerator::initialize();
Board board;
board.reset();
while(!board.isFinalState()) {
std::cout << "\x1B[2J\x1B[H" << mastHead << board;
Engine<true> engine1(board, 6);
Engine<false> engine2(board, 6);
high_resolution_clock::time_point t1 = high_resolution_clock::now();
Move move1 = engine1.getBestMove();
high_resolution_clock::time_point t2 = high_resolution_clock::now();
Move move2 = engine2.getBestMove();
high_resolution_clock::time_point t3 = high_resolution_clock::now();
auto duration1 = duration_cast<microseconds>(t2 - t1).count();
auto duration2 = duration_cast<microseconds>(t3 - t2).count();
std::cout << duration1 << " / " << duration2 << std::endl;
std::cout << move1 << " / " << move2 << std::endl;
if(move1 != move2) {
std::cerr << "Unequal move computed!" << std::endl;
break;
}
board.applyMove(move1);
}
return 0;
}