Merge pull request #33 from rektdie/FP
Fp bench 684523
This commit was merged in pull request #33.
This commit is contained in:
3 files changed
+17
-2
No files matched your search
+6
-1
@@ -49,12 +49,17 @@ public:
|
|||||||
return m_move >> 12;
|
return m_move >> 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
int IsCapture() {
|
bool IsCapture() {
|
||||||
return (GetFlags() == capture || GetFlags() == epCapture
|
return (GetFlags() == capture || GetFlags() == epCapture
|
||||||
|| GetFlags() == knightPromoCapture || GetFlags() == bishopPromoCapture
|
|| GetFlags() == knightPromoCapture || GetFlags() == bishopPromoCapture
|
||||||
|| GetFlags() == rookPromoCapture || GetFlags() == queenPromoCapture);
|
|| GetFlags() == rookPromoCapture || GetFlags() == queenPromoCapture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsQuiet() {
|
||||||
|
return (GetFlags() == quiet || GetFlags() == kingCastle
|
||||||
|
|| GetFlags() == queenCastle || GetFlags() == doublePawnPush);
|
||||||
|
}
|
||||||
|
|
||||||
void PrintMove() {
|
void PrintMove() {
|
||||||
std::cout << squareCoords[MoveFrom()] << squareCoords[MoveTo()];
|
std::cout << squareCoords[MoveFrom()] << squareCoords[MoveTo()];
|
||||||
|
|
||||||
|
|||||||
+10
-1
@@ -231,6 +231,15 @@ SearchResults PVS(Board board, int depth, int alpha, int beta, int ply) {
|
|||||||
for (int i = 0; i < board.currentMoveIndex; i++) {
|
for (int i = 0; i < board.currentMoveIndex; i++) {
|
||||||
Move currMove = board.moveList[i];
|
Move currMove = board.moveList[i];
|
||||||
|
|
||||||
|
// Futility pruning
|
||||||
|
// If our static eval is far below alpha, there is only a small chance
|
||||||
|
// that a quiet move will help us so we skip them
|
||||||
|
int fpMargin = 100 * depth;
|
||||||
|
if (!isPV && ply && !board.InCheck() && currMove.IsQuiet()
|
||||||
|
&& depth <= 5 && staticEval + fpMargin < alpha && results.score > MATE_SCORE) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Board copy = board;
|
Board copy = board;
|
||||||
bool isLegal = copy.MakeMove(currMove);
|
bool isLegal = copy.MakeMove(currMove);
|
||||||
|
|
||||||
@@ -288,7 +297,7 @@ SearchResults PVS(Board board, int depth, int alpha, int beta, int ply) {
|
|||||||
|
|
||||||
if (moveSeen == 0) {
|
if (moveSeen == 0) {
|
||||||
if (board.InCheck()) { // checkmate
|
if (board.InCheck()) { // checkmate
|
||||||
return -99000 + ply;
|
return MATE_SCORE + ply;
|
||||||
} else { // stalemate
|
} else { // stalemate
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
namespace SEARCH {
|
namespace SEARCH {
|
||||||
|
|
||||||
|
constexpr int MATE_SCORE = -99000;
|
||||||
constexpr int maxDepth = 64;
|
constexpr int maxDepth = 64;
|
||||||
constexpr int maxHistory = 16384;
|
constexpr int maxHistory = 16384;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user