else if (token == "eval")
{
EvalInfo ei;
- cout << "Incremental mg: " << RootPosition.value().mg()
- << "\nIncremental eg: " << RootPosition.value().eg()
+ cout << "Incremental mg: " << mg_value(RootPosition.value())
+ << "\nIncremental eg: " << eg_value(RootPosition.value())
<< "\nFull eval: " << evaluate(RootPosition, ei, 0) << endl;
}
else if (token == "key")
void perft(UCIInputParser& uip) {
string token;
- int depth = 0;
+ int depth, tm, n;
+ Position pos = RootPosition;
- while (!uip.eof())
- {
- uip >> token;
+ if (uip.eof())
+ return;
+
+ uip >> depth;
+ tm = get_system_time();
+
+ n = perft(pos, depth * OnePly);
- if (token == "depth")
- uip >> depth;
- }
- Position pos = RootPosition;
- int tm = get_system_time();
- int n = perft(pos, depth * OnePly);
tm = get_system_time() - tm;
std::cout << "\nNodes " << n
<< "\nTime (ms) " << tm