#ifdef ENABLE_NLS
# define _(s) gettext (s)
# define N_(s) gettext_noop (s)
+# define T_(s) gettext(s)
#else
-# define _(s) (s)
-# define N_(s) s
+# ifdef WIN32
+# define _(s) T_(s)
+# define N_(s) s
+# else
+# define _(s) (s)
+# define N_(s) s
+# define T_(s) s
+# endif
#endif
/* [AS] Adjudication threshold */
adjudicateLossThreshold = appData.adjudicateLossThreshold;
- first.which = "first";
- second.which = "second";
+ first.which = _("first");
+ second.which = _("second");
first.maybeThinking = second.maybeThinking = FALSE;
first.pr = second.pr = NoProc;
first.isr = second.isr = NULL;
/* POP Fabien */
sprintf(user_move, "o-o-o\n");
break;
+ case WhiteNonPromotion:
+ case BlackNonPromotion:
+ sprintf(user_move, "%c%c%c%c=\n", AAA + fromX, ONE + fromY, AAA + toX, ONE + toY);
+ break;
case WhitePromotionQueen:
case BlackPromotionQueen:
case WhitePromotionRook:
case BlackPromotionKnight:
case WhitePromotionKing:
case BlackPromotionKing:
+ case WhiteNonPromotion:
+ case BlackNonPromotion:
case NormalMove:
case WhiteCapturesEnPassant:
case BlackCapturesEnPassant:
SendMoveToProgram(forwardMostMove-1, engineOpponent); // make sure opponent gets move
ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/
GameEnds( WhiteOnMove(forwardMostMove) ? BlackWins : WhiteWins,
- _("Xboard adjudication: King destroyed"), GE_XBOARD );
+ "Xboard adjudication: King destroyed", GE_XBOARD );
return 1;
}
}
SendMoveToProgram(forwardMostMove-1, engineOpponent); // make sure opponent gets to see move
ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/
GameEnds( WhiteOnMove(forwardMostMove) ? WhiteWins : BlackWins,
- _("Xboard adjudication: Bare king"), GE_XBOARD );
+ "Xboard adjudication: Bare king", GE_XBOARD );
return 1;
}
} else
SendMoveToProgram(forwardMostMove-1, engineOpponent); // make sure opponent gets move
ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/
GameEnds( nrW > 1 ? WhiteWins : nrB > 1 ? BlackWins : GameIsDrawn,
- _("Xboard adjudication: Bare king"), GE_XBOARD );
+ "Xboard adjudication: Bare king", GE_XBOARD );
return 1;
}
}
if(MateTest(boards[i], PosFlags(i)) == MT_CHECK)
checkCnt++;
if(checkCnt >= 2) {
- reason = _("Xboard adjudication: 3rd check");
+ reason = "Xboard adjudication: 3rd check";
boards[forwardMostMove][EP_STATUS] = EP_CHECKMATE;
break;
}
break;
case MT_STALEMATE:
case MT_STAINMATE:
- reason = _("Xboard adjudication: Stalemate");
+ reason = "Xboard adjudication: Stalemate";
if((signed char)boards[forwardMostMove][EP_STATUS] != EP_CHECKMATE) { // [HGM] don't touch win through baring or K-capt
boards[forwardMostMove][EP_STATUS] = EP_STALEMATE; // default result for stalemate is draw
if(gameInfo.variant == VariantLosers || gameInfo.variant == VariantGiveaway) // [HGM] losers:
}
break;
case MT_CHECKMATE:
- reason = _("Xboard adjudication: Checkmate");
+ reason = "Xboard adjudication: Checkmate";
boards[forwardMostMove][EP_STATUS] = (gameInfo.variant == VariantLosers ? EP_WINS : EP_CHECKMATE);
break;
}
SendMoveToProgram(forwardMostMove-1, engineOpponent); /* make sure opponent gets to see last move */
}
ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/
- GameEnds( GameIsDrawn, _("Xboard adjudication: Insufficient mating material"), GE_XBOARD );
+ GameEnds( GameIsDrawn, "Xboard adjudication: Insufficient mating material", GE_XBOARD );
return 1;
}
}
SendMoveToProgram(forwardMostMove-1, engineOpponent); /* make sure opponent gets to see move */
}
ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/
- GameEnds( GameIsDrawn, _("Xboard adjudication: Trivial draw"), GE_XBOARD );
+ GameEnds( GameIsDrawn, "Xboard adjudication: Trivial draw", GE_XBOARD );
return 1;
}
} else moveCount = 6;
&& appData.drawRepeats > 1) {
/* adjudicate after user-specified nr of repeats */
int result = GameIsDrawn;
- char *details = _("XBoard adjudication: repetition draw");
+ char *details = "XBoard adjudication: repetition draw";
if(gameInfo.variant == VariantXiangqi && appData.testLegality) {
// [HGM] xiangqi: check for forbidden perpetuals
int m, ourPerpetual = 1, hisPerpetual = 1;
ourPerpetual, hisPerpetual);
if(ourPerpetual && !hisPerpetual) { // we are actively checking him: forfeit
result = WhiteOnMove(forwardMostMove) ? WhiteWins : BlackWins;
- details = _("Xboard adjudication: perpetual checking");
+ details = "Xboard adjudication: perpetual checking";
} else
if(hisPerpetual && !ourPerpetual) { // he is checking us, but did not repeat yet
break; // (or we would have caught him before). Abort repetition-checking loop.
ourPerpetual = PerpetualChase(k+1, forwardMostMove);
if(ourPerpetual && !hisPerpetual) { // we are actively chasing him: forfeit
result = WhiteOnMove(forwardMostMove) ? WhiteWins : BlackWins;
- details = _("Xboard adjudication: perpetual chasing");
+ details = "Xboard adjudication: perpetual chasing";
} else
if(hisPerpetual && !ourPerpetual) // he is chasing us, but did not repeat yet
break; // Abort repetition-checking loop.
SendMoveToProgram(forwardMostMove-1, engineOpponent); /* make sure opponent gets to see move */
}
ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/
- GameEnds( GameIsDrawn, _("Xboard adjudication: 50-move rule"), GE_XBOARD );
+ GameEnds( GameIsDrawn, "Xboard adjudication: 50-move rule", GE_XBOARD );
return 1;
}
SendMoveToProgram(forwardMostMove-1, engineOpponent); /* make sure opponent gets to see move */
}
ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/
- GameEnds( GameIsDrawn, _("Xboard adjudication: long game"), GE_XBOARD );
+ GameEnds( GameIsDrawn, "Xboard adjudication: long game", GE_XBOARD );
return 1;
}
return 0;
ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/
GameEnds( WhiteOnMove(forwardMostMove) ? WhiteWins : BlackWins,
- _("Xboard adjudication"),
+ "Xboard adjudication",
GE_XBOARD );
return;
case BlackPromotionKnight:
case WhitePromotionKing:
case BlackPromotionKing:
+ case WhiteNonPromotion:
+ case BlackNonPromotion:
case NormalMove:
case WhiteCapturesEnPassant:
case BlackCapturesEnPassant:
/* [HGM] compute & store e.p. status and castling rights for new position */
/* we can always do that 'in place', now pointers to these rights are passed to ApplyMove */
- { int i;
if(gameInfo.variant == VariantBerolina) berolina = EP_BEROLIN_A;
oldEP = (signed char)board[EP_STATUS];
if( board[toY][toX] != EmptySquare )
board[EP_STATUS] = EP_CAPTURE;
+ /* [HGM] In Shatranj and Courier all promotions are to Ferz */
+ if((gameInfo.variant==VariantShatranj || gameInfo.variant==VariantCourier || gameInfo.variant == VariantMakruk)
+ && promoChar != 0) promoChar = PieceToChar(WhiteFerz);
+
+ if (fromY == DROP_RANK) {
+ /* must be first */
+ piece = board[toY][toX] = (ChessSquare) fromX;
+ } else {
+ int i;
+
if( board[fromY][fromX] == WhitePawn ) {
if(fromY != toY) // [HGM] Xiangqi sideway Pawn moves should not count as 50-move breakers
board[EP_STATUS] = EP_PAWN_MOVE;
) board[CASTLING][i] = NoRights; // revoke for moved or captured piece
}
- }
-
- /* [HGM] In Shatranj and Courier all promotions are to Ferz */
- if((gameInfo.variant==VariantShatranj || gameInfo.variant==VariantCourier || gameInfo.variant == VariantMakruk)
- && promoChar != 0) promoChar = PieceToChar(WhiteFerz);
-
- if (fromX == toX && fromY == toY) return;
+ if (fromX == toX && fromY == toY) return;
- if (fromY == DROP_RANK) {
- /* must be first */
- piece = board[toY][toX] = (ChessSquare) fromX;
- } else {
piece = board[fromY][fromX]; /* [HGM] remember, for Shogi promotion */
king = piece < (int) BlackPawn ? WhiteKing : BlackKing; /* [HGM] Knightmate simplify testing for castling */
if(gameInfo.variant == VariantKnightmate)
case BlackPromotionKnight:
case WhitePromotionKing:
case BlackPromotionKing:
+ case WhiteNonPromotion:
+ case BlackNonPromotion:
case NormalMove:
case WhiteKingSideCastle:
case WhiteQueenSideCastle:
sprintf(res, " %s", PGNResult(gameInfo.result));
} else {
sprintf(res, " {%s} %s",
- gameInfo.resultDetails, PGNResult(gameInfo.result));
+ T_(gameInfo.resultDetails), PGNResult(gameInfo.result));
}
} else {
res[0] = NULLCHAR;