aboutsummaryrefslogtreecommitdiff
path: root/src/bot.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bot.cpp')
-rw-r--r--src/bot.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/bot.cpp b/src/bot.cpp
index 14f7cef..5db3939 100644
--- a/src/bot.cpp
+++ b/src/bot.cpp
@@ -68,6 +68,10 @@ static int ScoreMove(const Game *board, const Move &move,
score += 8000;
}
+ if (move.To.rank == (board->turn ? 6 : 1) && moving.type == PAWN) {
+ score += 8000;
+ }
+
return score;
}
@@ -80,14 +84,9 @@ static std::vector<Move> GetSortedLegalMoves(Game *g, bool generateQuietMoves,
return moves;
}
-// Quiescence search: only captures, so the eval isn't blind to hanging pieces.
-// `standPat` lets the side to move decline every capture. Terminal positions
-// are scored with the same `MATE - ply` convention as the main search so that
-// mate distances stay consistent (a mate found inside quiescence must not look
-// faster than a real mate-in-1). White perspective throughout.
static int quiescenceSearch(Game *b, int qdepth, int alpha, int beta, int ply) {
Nodes++;
- // Runs GetNewGameState internally, so b->state is up to date afterwards.
+
const int standPat = EvaluateBoard(b);
switch (b->state) {
@@ -208,7 +207,6 @@ static int search(int depth, Game *b, int alpha, int beta, int ply) {
}
}
if (!searchStopped) {
-
Flag flag = EXACT;
if (bestScore >= beta) {
flag = LOWERBOUND;