Null Move Pruning
Diffstat:
2 files changed, 14 insertions(+), 1 deletions(-)
@@ -3,7 +3,7 @@
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(
Stellar
VERSION 0.0.13
VERSION 0.0.14
DESCRIPTION "Chess engine written in C"
HOMEPAGE_URL https://git.dimitrijedobrota.com/stellar.git
LANGUAGES C
@@ -16,6 +16,7 @@
#define MAX_PLY 64
#define FULL_DEPTH 4
#define REDUCTION_LIMIT 3
#define REDUCTION_MOVE 2
#define INFINITY 50000
#define WINDOW 50
@@ -151,6 +152,18 @@
int negamax(Stats *stats, const Board *board, int alpha, int beta, int depth) {
if (isCheck) depth++;
Board copy;
if (depth >= 3 && !isCheck && stats->ply) {
board_copy(board, ©);
board_side_switch(©);
board_enpassant_set(©, no_sq);
int score = -negamax(stats, ©, -beta, -beta + 2,
depth - 1 - REDUCTION_MOVE);
if (score >= beta) return beta;
}
MoveList list;
move_list_generate(&list, board);