Skip to content

Commit

Permalink
Save 5 tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
codedeliveryservice committed Sep 15, 2023
1 parent 7091576 commit ab08e99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Chess-Challenge/src/My Bot/MyBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private int AlphaBeta(int depth, int alpha, int beta, bool nullMoveAllowed = tru
// The TT entry is from a different position, so no best move is available
if (ttZobrist != zobrist)
ttMove = default;
else if (!root && ttDepth >= depth && (ttFlag is 1 || ttFlag is 2 && ttScore >= beta || ttFlag is 3 && ttScore <= alpha))
else if (!root && ttDepth >= depth && (ttFlag != 3 && ttScore >= beta || ttFlag != 2 && ttScore <= alpha))
return ttScore;

bool pvNode = alpha != beta - 1;
Expand Down Expand Up @@ -334,7 +334,7 @@ private int AlphaBeta(int depth, int alpha, int beta, bool nullMoveAllowed = tru

// Checkmate or stalemate
if (!inQSearch && moveCount < 1)
return inCheck ? -20_000_000 + board.PlyCount : 0;
return inCheck ? board.PlyCount - 20_000_000 : 0;

transpositionTable[zobrist % TABLE_SIZE] = (zobrist, depth, alpha, nodeFlag, ttMove);
stats.TracePVOrAllNodes(nodeFlag, latestAlpha); // #DEBUG
Expand Down

0 comments on commit ab08e99

Please sign in to comment.