-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
37 lines (34 loc) · 1.11 KB
/
Copy pathmain.cpp
File metadata and controls
37 lines (34 loc) · 1.11 KB
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
#include "search.h"
#include "tb.h"
#include "tune.h"
#include "uci.h"
#include "ucioption.h"
#include <iostream>
#include <new>
using namespace engine;
#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
int main() {
std::cout << std::unitbuf;
std::cout << "cppchess_engine version " << BUILD_VERSION << '\n';
options.add("Move Overhead", Option(10, 0, 1000));
options.add("Hash", Option(16, 1, 1 << 25, [](const Option &o) {
try {
search::tt.resize(int(o));
} catch (std::bad_alloc &) {
std::cerr << "info string Hash resize failed: bad_alloc\n";
}
return std::nullopt;
}));
options.add("Clear Hash", Option(+[](const Option &) {
search::tt.clear();
return std::nullopt;
}));
options.add("SyzygyPath", Option("", [](const Option &o) {
tb::init(std::string(o));
return std::nullopt;
}));
Tune::init(options);
std::cout.flush();
loop();
}