Skip to content

Commit 1c9d05a

Browse files
committed
merged
2 parents 528ba55 + a87d311 commit 1c9d05a

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

search.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,18 @@ Value doSearch(Board &board, int depth, Value alpha, Value beta,
111111
return board.checkers() ? -MATE(ply) : 0;
112112
}
113113
movepick::orderMoves(board, moves, preferred, ply);
114-
if (bool useNMP=depth>=3 && !board.checkers() && ply>0){
115-
int R=2+depth/6;
114+
if (bool useNMP = depth >= 3 && !board.checkers() && ply > 0) {
115+
int R = 2 + depth / 6;
116116
board.doNullMove();
117-
Value score=doSearch(board, depth-1-R, -beta, -beta+1, session, ply+1);
118-
board.undoMove();
117+
Value score =
118+
doSearch(board, depth - 1 - R, -beta, -beta + 1, session, ply + 1);
119+
119120
if (score == VALUE_NONE)
120121
return VALUE_NONE;
121-
score=-score;
122-
if (score>=beta) return beta;
122+
score = -score;
123+
board.undoMove();
124+
if (score >= beta)
125+
return beta;
123126
}
124127
for (Move move : moves) {
125128
board.doMove(move);

0 commit comments

Comments
 (0)