From: H.G.Muller Date: Fri, 24 Jul 2015 16:08:51 +0000 (+0200) Subject: Make Lion in Chu move as Lion again X-Git-Url: http://winboard.nl/cgi-bin?p=hachu.git;a=commitdiff_plain;h=c4e3ca27221502687231f95089c69dd64cf000ca Make Lion in Chu move as Lion again I had used it for testing the Werewolf, and forgotten to put it back to a normal Lion afterwards. --- diff --git a/hachu.c b/hachu.c index 616b656..f1db2ee 100644 --- a/hachu.c +++ b/hachu.c @@ -191,9 +191,7 @@ Move retMove, moveStack[20000], path[100], repStack[300], pv[1000], repeatMove[3 #define FVAL 5000 /* piece value of Fire Demon. Used in code for recognizing moves with it and do burns */ PieceDesc chuPieces[] = { - {"LN", "", LVAL, { W,W,W,W,W,W,W,W }, 4 }, // lion -// {"LN", "", LVAL, { T,T,T,T,T,T,T,T }, 4 }, // lion -// {"LN", "", LVAL, { L,L,L,L,L,L,L,L }, 4 }, // lion + {"LN", "", LVAL, { L,L,L,L,L,L,L,L }, 4 }, // lion {"FK", "", 600, { X,X,X,X,X,X,X,X }, 4 }, // free king {"SE", "", 550, { X,D,X,X,X,X,X,D }, 4 }, // soaring eagle {"HF", "", 500, { D,X,X,X,X,X,X,X }, 4 }, // horned falcon @@ -1456,11 +1454,12 @@ MakeMove(Move m, UndoInfo *u) u->victim = board[u->to]; p[u->victim].pos = ABSENT; - if(p[u->victim].ranking == 5 && p[u->piece].ranking != 4) { // contageous piece captured by non-royal + if(p[u->victim].ranking == 5 && p[u->piece].ranking < 4) { // contageous piece captured by non-royal + u->booty -= p[u->new].value; u->new = u->piece & 1 | 2; // promote to it - p[u->piece].pos = ABSENT; - u->booty += p[u->new].value - p[u->piece].value; if(p[u->new].pos != ABSENT) u->new += 2; + p[u->piece].pos = ABSENT; + u->booty += p[u->new].value; } u->booty += PST[p[u->new].pst + u->to] - PST[p[u->piece].pst + u->from]; @@ -1995,6 +1994,7 @@ if(PATH) printf("# probe hash index=%x hit=%d\n", index, hit),fflush(stdout); if(hit >= 0) { bestScore = hashTable[index].score[hit]; hashMove = hashTable[index].move[hit]; + if((bestScore <= alpha || hashTable[index].flag[hit] & H_LOWER) && (bestScore >= beta || hashTable[index].flag[hit] & H_UPPER) ) { iterDep = resDep = hashTable[index].depth[hit]; bestMoveNr = 0; @@ -2549,7 +2549,7 @@ MoveToText (MOVE move, int multiLine) } t = g + toList[t - SPECIAL]; } - if(move & PROMOTE) promoChar = currentVariant == V_MAKRUK ? "m" : repDraws ? "q" : "+"; + if(move & PROMOTE) promoChar = currentVariant == V_MAKRUK ? "m" : currentVariant == V_WOLF ? "r" : repDraws ? "q" : "+"; sprintf(buf+strlen(buf), "%c%d%c%d%s", f%BW+'a', f/BW+ONE, t%BW+'a', t/BW+ONE, promoChar); return buf; } @@ -2582,7 +2582,7 @@ MapFromScratch(attacks); for(i=listStart; i> SQLEN & SQUARE; if(to >= SPECIAL) continue; - if(p[board[to]].ranking == 5 && p[board[from]].ranking != 4) moveStack[i] |= PROMOTE; + if(p[board[to]].ranking == 5 && p[board[from]].ranking < 4) moveStack[i] |= PROMOTE; } } @@ -2633,6 +2633,7 @@ ParseMove (char *moveText) if(t == f-2 && f > BW) t2 = CASTLE + 3; } ret = f<= listEnd) { @@ -2890,7 +2891,7 @@ pboard(board); } stm = MakeMove2(stm, move); // assumes MakeMove returns new side to move gameMove[moveNr++] = move; // remember game - printf("move %s%s\n", MoveToText(pMove, 1), p[undoInfo.victim].ranking == 5 && p[undoInfo.piece].ranking != 4 ? "w" : ""); + printf("move %s%s\n", MoveToText(pMove, 1), p[undoInfo.victim].ranking == 5 && p[undoInfo.piece].ranking < 4 ? "w" : ""); listEnd = 0; continue; // go check if we should ponder }