mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-19 08:36:33 +08:00
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:
21
src/uci.cpp
21
src/uci.cpp
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user