From 8cdb6b99332b57bbc67758095cd740836060a015 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 12 Aug 2026 09:06:44 +0200 Subject: fixing --- src/bot.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/bot.cpp') 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 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; -- cgit v1.2.3