From 79c2db473050b802ced129d39a557e47053a2f71 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 27 May 2013 22:46:34 +0200 Subject: [PATCH] Implement killers --- hachu.c | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/hachu.c b/hachu.c index 97cab1b..c9350ae 100644 --- a/hachu.c +++ b/hachu.c @@ -17,6 +17,7 @@ //define PATH 0 #define HASH +#define KILLERS #include #include @@ -113,7 +114,7 @@ char *array, fenArray[4000], *reason; int bWidth, bHeight, bsize, zone, currentVariant, chuFlag, tenFlag, chessFlag, repDraws; int stm, xstm, hashKeyH, hashKeyL, framePtr, msp, nonCapts, rootEval, retMSP, retFirst, retDep, pvPtr, level, cnt50, mobilityScore; int nodes, startTime, tlim1, tlim2, repCnt, comp; -Move retMove, moveStack[10000], path[100], repStack[300], pv[1000], repeatMove[300]; +Move retMove, moveStack[10000], path[100], repStack[300], pv[1000], repeatMove[300], killer[100][2]; int maxDepth; // used by search @@ -1694,6 +1695,14 @@ if(PATH) printf("%d:%2d:%2d msp=%d\n",level,depth,iterDep,msp); case 6: // non-captures nonCapts = msp; nullMove = GenNonCapts(oldPromo); +#ifdef KILLERS + { // swap killers to front + Move h = killer[level][0]; int j = curMove; + for(i=curMove; i= beta) { // beta cutoff - // update killer +#ifdef KILLERS + if(iterDep == depth && move != killer[level][0]) { + // update killer + killer[level][1] = killer[level][0]; killer[level][0] = move; + } +#endif resDep = retDep; goto cutoff; } -- 1.7.0.4