Use a more standard perft UCI interface

Call directly 'perft 6' to search up to depth 6*OnePly
instead of the old 'perft depth 6'.

It is more in line to what other engines do. Also a bit
of cleanup while there.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2009-11-13 10:27:14 +01:00
parent 7d0e0ff95e
commit a530fc2b60
2 changed files with 16 additions and 17 deletions

View File

@@ -324,18 +324,17 @@ namespace {
void perft(UCIInputParser& uip) {
string token;
int depth = 0;
while (!uip.eof())
{
uip >> token;
if (token == "depth")
uip >> depth;
}
int depth, tm, n;
Position pos = RootPosition;
int tm = get_system_time();
int n = perft(pos, depth * OnePly);
if (uip.eof())
return;
uip >> depth;
tm = get_system_time();
n = perft(pos, depth * OnePly);
tm = get_system_time() - tm;
std::cout << "\nNodes " << n
<< "\nTime (ms) " << tm