X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=hachu.c;h=503d06165426f3015d3fe5761ff5d7af984f7153;hb=ffaca03a425220a0ed043bb48ee2a94b86aab60b;hp=9b98aa736c1d4bae37463ccbbc89b354ec218baf;hpb=77ad1e5157ad3cf48244f2377f90272d3bb4a1c1;p=hachu.git diff --git a/hachu.c b/hachu.c index 9b98aa7..503d061 100644 --- a/hachu.c +++ b/hachu.c @@ -166,7 +166,7 @@ int retMSP, retFirst, retDep, pvPtr, level, cnt50, mobilityScore; int ll, lr, ul, ur; // corner squares int nodes, startTime, lastRootMove, lastRootIter, tlim1, tlim2, tlim3, repCnt, comp, abortFlag; Move ponderMove; -Move retMove, moveStack[10000], path[100], repStack[300], pv[1000], repeatMove[300], killer[100][2]; +Move retMove, moveStack[20000], path[100], repStack[300], pv[1000], repeatMove[300], killer[100][2]; int maxDepth; // used by search @@ -1796,7 +1796,12 @@ if(PATH) /*pboard(board),pmap(attacks, BLACK),*/printf("search(%d) {%d,%d} eval= if( k == ABSENT) { if((k = p[king + 2].pos) == ABSENT && (!tsume || tsume & stm+1)) return -INF; // lose when no King (in tsume only for side to be mated) - } else if(p[king + 2].pos != ABSENT) k = ABSENT; // two kings is no king... + } else if(p[king + 2].pos != ABSENT) { + if(tsume && tsume & stm+1) { + retDep = 60; return INF; // we win when not in check + } + k = ABSENT; // two kings is no king... + } if( k != ABSENT) { // check is possible if(!attacks[2*k + xstm]) { if(tsume && tsume & stm+1) { @@ -2022,6 +2027,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) { + retDep = iterDep; if(repDraws) { score = 0; goto repetition; } if(!allowRep) { moveStack[curMove] = 0; // erase forbidden move @@ -2141,7 +2147,7 @@ if(PATH) printf("%d:%2d:%d %3d %6x %-10s %6d %6d (%d)\n", level, depth, iterDep #ifdef HASH // hash store hashTable[index].lock[hit] = hashKeyH; - hashTable[index].depth[hit] = iterDep; + hashTable[index].depth[hit] = resDep; hashTable[index].score[hit] = bestScore; hashTable[index].flag[hit] = (bestScore < beta) * H_UPPER; if(bestScore > alpha) { @@ -2233,7 +2239,7 @@ pmoves(int start, int end) // some parameter of your engine #define MAXMOVES 2000 /* maximum game length */ - #define MAXPLY 30 /* maximum search depth */ + #define MAXPLY 60 /* maximum search depth */ #define OFF 0 #define ON 1