- think(RootPosition, infinite, ponder, RootPosition.side_to_move(), time,
- inc, movesToGo, depth, nodes, moveTime, searchMoves);
+ return think(RootPosition, infinite, ponder, RootPosition.side_to_move(),
+ time, inc, movesToGo, depth, nodes, moveTime, searchMoves);
+ }
+
+ void perft(UCIInputParser& uip) {
+
+ string token;
+ int depth = 0;
+
+ while (!uip.eof())
+ {
+ uip >> token;
+
+ 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
+ << "\nNodes/second " << (int)(n/(tm/1000.0)) << std::endl;