//define PATH 0\r
\r
#define HASH\r
+#define KILLERS\r
\r
#include <stdio.h>\r
#include <stdlib.h>\r
int bWidth, bHeight, bsize, zone, currentVariant, chuFlag, tenFlag, chessFlag, repDraws;\r
int stm, xstm, hashKeyH, hashKeyL, framePtr, msp, nonCapts, rootEval, retMSP, retFirst, retDep, pvPtr, level, cnt50, mobilityScore;\r
int nodes, startTime, tlim1, tlim2, repCnt, comp;\r
-Move retMove, moveStack[10000], path[100], repStack[300], pv[1000], repeatMove[300];\r
+Move retMove, moveStack[10000], path[100], repStack[300], pv[1000], repeatMove[300], killer[100][2];\r
\r
int maxDepth; // used by search\r
\r
case 6: // non-captures\r
nonCapts = msp;\r
nullMove = GenNonCapts(oldPromo);\r
+#ifdef KILLERS\r
+ { // swap killers to front\r
+ Move h = killer[level][0]; int j = curMove;\r
+ for(i=curMove; i<msp; i++) if(moveStack[i] == h) { moveStack[i] = moveStack[j]; moveStack[j++] = h; break; }\r
+ h = killer[level][1];\r
+ for(i=curMove; i<msp; i++) if(moveStack[i] == h) { moveStack[i] = moveStack[j]; moveStack[j++] = h; break; }\r
+ }\r
+#endif\r
phase = 7;\r
sorted = msp; // do not sort noncapts\r
break;\r
}\r
bestMoveNr = firstMove;\r
if(score >= beta) { // beta cutoff\r
- // update killer\r
+#ifdef KILLERS\r
+ if(iterDep == depth && move != killer[level][0]) {\r
+ // update killer\r
+ killer[level][1] = killer[level][0]; killer[level][0] = move;\r
+ }\r
+#endif\r
resDep = retDep;\r
goto cutoff;\r
}\r