mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +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:
@@ -333,14 +333,14 @@ namespace {
|
||||
int perft(Position& pos, Depth depth)
|
||||
{
|
||||
Move move;
|
||||
MovePicker mp = MovePicker(pos, MOVE_NONE, depth, H);
|
||||
int sum = 0;
|
||||
MovePicker mp = MovePicker(pos, MOVE_NONE, depth, H);
|
||||
|
||||
// If we are at the last ply we don't need to do and undo
|
||||
// the moves, just to count them.
|
||||
if (depth <= OnePly) // Replace with '<' to test also qsearch
|
||||
{
|
||||
while ((move = mp.get_next_move()) != MOVE_NONE) sum++;
|
||||
while (mp.get_next_move()) sum++;
|
||||
return sum;
|
||||
}
|
||||
|
||||
@@ -348,10 +348,10 @@ int perft(Position& pos, Depth depth)
|
||||
CheckInfo ci(pos);
|
||||
while ((move = mp.get_next_move()) != MOVE_NONE)
|
||||
{
|
||||
StateInfo st;
|
||||
pos.do_move(move, st, ci, pos.move_is_check(move, ci));
|
||||
sum += perft(pos, depth - OnePly);
|
||||
pos.undo_move(move);
|
||||
StateInfo st;
|
||||
pos.do_move(move, st, ci, pos.move_is_check(move, ci));
|
||||
sum += perft(pos, depth - OnePly);
|
||||
pos.undo_move(move);
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user