// promotions by pieces with Lion power stepping in & out the zone in same turn\r
// promotion on capture\r
\r
-#define VERSION "0.19"\r
+#define VERSION "0.20"\r
\r
//define PATH level==0 || path[0] == 0x590cb && (level==1 || path[1] == 0x4c0c9 && (level == 2 || path[2] == 0x8598ca && (level == 3 /*|| path[3] == 0x3e865 && (level == 4 || path[4] == 0x4b865 && (level == 5))*/)))\r
#define PATH 0\r
} PieceDesc;\r
\r
typedef struct {\r
- int from, to, piece, victim, new, booty, epSquare, epVictim[8], ep2Square, revMoveCount;\r
+ int from, to, piece, victim, new, booty, epSquare, epVictim[9], ep2Square, revMoveCount;\r
int savKeyL, savKeyH, gain, loss, filling, saveDelta;\r
char fireMask;\r
} UndoInfo;\r
{\r
if(board[y] != EMPTY) return 1; // edge, capture or own piece\r
//if(flag) printf("# add %c%d%c%d, pf=%d\n", x%BW+'a',x/BW,y%BW+'a',y/BW, promoFlags);\r
- if( (promoBoard[x] | promoBoard[y]) & promoFlags &&\r
- (!entryProm || promoBoard[y] & ~promoBoard[x] & CAN_PROMOTE )){ // piece can promote with this move\r
+ if( (entryProm ? promoBoard[y] & ~promoBoard[x] & CAN_PROMOTE\r
+ : promoBoard[y] | promoBoard[x] ) & promoFlags ){ // piece can promote with this move\r
moveStack[msp++] = moveStack[nonCapts]; // create space for promotion\r
moveStack[nonCapts++] = x<<SQLEN | y | PROMOTE; // push promotion\r
if((promoFlags & promoBoard[y] & (CANT_DEFER | DONT_DEFER | LAST_RANK)) == 0) { // deferral could be a better alternative\r
if(!*fen) break;\r
fen++;\r
}\r
+ *p = '\0';\r
printf("# converted FEN '%s'\n", fenArray);\r
return fenArray;\r
}\r
\r
main()\r
{\r
- int engineSide=NONE; // side played by engine\r
+ int engineSide=NONE; // side played by engine\r
MOVE move;\r
int i, score, curVarNr;\r
\r
- Init(V_CHU); // Chu\r
+ setvbuf(stdin, NULL, _IOLBF, 1024); // buffering more than one line flaws test for pending input!\r
+\r
+ Init(V_CHU); // Chu\r
seed = startTime = GetTickCount(); moveNr = 0; // initialize random\r
\r
while(1) { // infinite loop\r
\r
- fflush(stdout); // make sure everything is printed before we do something that might take time\r
+ fflush(stdout); // make sure everything is printed before we do something that might take time\r
*inBuf = 0; if(moveNr >= 20) randomize = OFF;\r
//if(moveNr >20) printf("resign\n");\r
\r