Qs see #68
No files matched your search
+6
-7
@@ -132,12 +132,12 @@ static int GetReductions(Board &board, Move &move, int depth, int moveSeen, int
|
|||||||
return std::clamp(reduction, -1, depth - 1);
|
return std::clamp(reduction, -1, depth - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int SEE(Board& board, Move& move, int threshold) {
|
static bool SEE(Board& board, Move& move, int threshold) {
|
||||||
int from = move.MoveFrom();
|
int from = move.MoveFrom();
|
||||||
int to = move.MoveTo();
|
int to = move.MoveTo();
|
||||||
int flags = move.GetFlags();
|
int flags = move.GetFlags();
|
||||||
|
|
||||||
int nextVictim = -1;
|
int nextVictim = board.GetPieceType(from);
|
||||||
|
|
||||||
// Next victim is moved piece or promo piece
|
// Next victim is moved piece or promo piece
|
||||||
if (move.IsPromo()) {
|
if (move.IsPromo()) {
|
||||||
@@ -146,8 +146,6 @@ static int SEE(Board& board, Move& move, int threshold) {
|
|||||||
} else {
|
} else {
|
||||||
nextVictim = move.GetFlags() - 5;
|
nextVictim = move.GetFlags() - 5;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
nextVictim = board.GetPieceType(from);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int balance = MoveEstimatedValue(board, move) - threshold;
|
int balance = MoveEstimatedValue(board, move) - threshold;
|
||||||
@@ -162,10 +160,11 @@ static int SEE(Board& board, Move& move, int threshold) {
|
|||||||
Bitboard rooks = board.pieces[Rook] | board.pieces[Queen];
|
Bitboard rooks = board.pieces[Rook] | board.pieces[Queen];
|
||||||
|
|
||||||
Bitboard occupied = board.occupied;
|
Bitboard occupied = board.occupied;
|
||||||
occupied = (occupied ^ Bitboard((1ULL << from))) | Bitboard((1ULL << to));
|
occupied.PopBit(from);
|
||||||
|
occupied.SetBit(to);
|
||||||
|
|
||||||
if (flags == epCapture)
|
if (flags == epCapture)
|
||||||
occupied ^= Bitboard(1ULL << board.enPassantTarget);
|
occupied.SetBit(board.enPassantTarget);
|
||||||
|
|
||||||
Bitboard attackers = board.AttacksTo(to, occupied) & occupied;
|
Bitboard attackers = board.AttacksTo(to, occupied) & occupied;
|
||||||
|
|
||||||
@@ -180,7 +179,7 @@ static int SEE(Board& board, Move& move, int threshold) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
occupied ^= Bitboard(1ULL << Bitboard(myAttackers & board.pieces[nextVictim]).getLS1BIndex());
|
occupied.PopBit(Bitboard(myAttackers & board.pieces[nextVictim]).getLS1BIndex());
|
||||||
|
|
||||||
if (nextVictim == Pawn || nextVictim == Bishop || nextVictim == Queen)
|
if (nextVictim == Pawn || nextVictim == Bishop || nextVictim == Queen)
|
||||||
attackers |= MOVEGEN::getBishopAttack(to, occupied) & bishops;
|
attackers |= MOVEGEN::getBishopAttack(to, occupied) & bishops;
|
||||||
|
|||||||
+2
-3
@@ -26,9 +26,8 @@ constexpr int inf = 100000;
|
|||||||
|
|
||||||
inline int lmrTable[MAX_DEPTH+1][MAX_MOVES];
|
inline int lmrTable[MAX_DEPTH+1][MAX_MOVES];
|
||||||
|
|
||||||
static const int SEEPieceValues[] = {
|
constexpr std::array<int, 6> SEEPieceValues = {
|
||||||
100, 300, 350, 500,
|
100, 300, 350, 500, 900, 0
|
||||||
900, 0, 0, 0,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void InitLMRTable();
|
void InitLMRTable();
|
||||||
|
|||||||
Reference in new issue
Block a user