X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=hachu.c;h=5c1a77b1558689ce30870d89e7c17aa2f58759d2;hb=a7be536091e66cb95037e2dd5be145f1d846b683;hp=8267b72e0dc358bf411bbc949835cae47833ccbd;hpb=a337bbb699ec5b9b53d5757a28a0ace33416ea76;p=hachu.git diff --git a/hachu.c b/hachu.c index 8267b72..5c1a77b 100644 --- a/hachu.c +++ b/hachu.c @@ -92,7 +92,7 @@ typedef struct { } UndoInfo; char *array, fenArray[4000], *reason; -int bWidth, bHeight, bsize, zone, currentVariant, chuFlag, tenFlag, chessFlag; +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]; @@ -676,7 +676,7 @@ AddPiece (int stm, PieceDesc *list) if(p[j].promo >= i) p[j].promo += 2; } if(royal[stm] >= i) royal[stm] += 2; - if(p[i].value == (currentVariant == V_SHO ? 410 : 280) ) royal[stm] = i; + if(p[i].value == (currentVariant == V_SHO ? 410 : 280) ) royal[stm] = i, p[i].pst = 0; p[i].qval = (currentVariant == V_TENJIKU ? list->ranking : 0); // jump-capture hierarchy return i; } @@ -761,6 +761,7 @@ Init (int var) chuFlag = (currentVariant == V_CHU); tenFlag = (currentVariant == V_TENJIKU); chessFlag = (currentVariant == V_CHESS); + repDraws = (currentVariant == V_CHESS || currentVariant == V_SHATRANJ); for(i= -1; i<9; i++) { // board steps in linear coordinates kStep[i] = STEP(direction[i&7].x, direction[i&7].y); // King @@ -1667,6 +1668,7 @@ if(flag & depth >= 0) printf("%2d:%d found %d/%d %08x %s\n", depth, iterDep, cur if(flag & depth >= 0) printf("%2d:%d made %d/%d %s\n", depth, iterDep, curMove, msp, MoveToText(moveStack[curMove], 0)); for(i=2; i<=cnt50; i+=2) if(repStack[level-i+200] == hashKeyH) { + if(repDraws) { score = 0; goto repetition; } moveStack[curMove] = 0; // erase forbidden move if(!level) repeatMove[repCnt++] = move & 0xFFFFFF; // remember outlawed move score = -INF; moveStack[curMove] = 0; goto repetition;