\r
// from moves.c, added WinBoard_F piece types and ranks / files\r
\r
-char *squareToChar[] = { "ay", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l" };\r
-\r
-char *squareToNum[] = {"naught", "1", "2", "3", "4", "5", "6", "7", "8", "9" };\r
-\r
-char *ordinals[] = {"zeroth", "first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth", "nineth"};\r
-\r
-char *pieceToName[] = {\r
- "White Pawn", "White Knight", "White Bishop", "White Rook", "White Queen",\r
- "White Guard", "White Elephant", "White Arch Bishop", "White Chancellor",\r
- "White General", "White Man", "White Cannon", "White Night Rider",\r
- "White Crowned Bishop", "White Crowned Rook", "White Grass Hopper", "White Veteran",\r
- "White Falcon", "White Amazon", "White Snake", "White Unicorn",\r
- "White King",\r
- "Black Pawn", "Black Knight", "Black Bishop", "Black Rook", "Black Queen",\r
- "Black Guard", "Black Elephant", "Black Arch Bishop", "Black Chancellor",\r
- "Black General", "Black Man", "Black Cannon", "Black Night Rider",\r
- "Black Crowned Bishop", "Black Crowned Rook", "Black Grass Hopper", "Black Veteran",\r
- "Black Falcon", "Black Amazon", "Black Snake", "Black Unicorn",\r
- "Black King",\r
- "Empty"\r
- };\r
+char *squareToChar[] = { "ay", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t" };\r
+\r
+char *squareToNum[] = {"naught", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20" };\r
+\r
+char *ordinals[] = {"zeroth", "first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth", "nineth", "tenth", "eleventh", "twelfth", "thriteenth", "fourteenth", "fifteenth", "sixteenth" };\r
\r
char *pieceTypeName[] = {\r
"Pawn", "Knight", "Bishop", "Rook", "Queen",\r
"Guard", "Elephant", "Arch Bishop", "Chancellor",\r
"General", "Man", "Cannon", "Night Rider",\r
"Crowned Bishop", "Crowned Rook", "Grass Hopper", "Veteran",\r
- "Falcon", "Amazon", "Snake", "Unicorn",\r
- "King",\r
- "Pawn", "Knight", "Bishop", "Rook", "Queen",\r
- "Guard", "Elephant", "Arch Bishop", "Chancellor",\r
- "General", "Man", "Cannon", "Night Rider",\r
- "Crowned Bishop", "Crowned Rook", "Grass Hopper", "Veteran",\r
- "Falcon", "Amazon", "Snake", "Unicorn",\r
+ "Falcon", "Lance", "Snake", "Unicorn", "Lion",\r
+ "Sword", "Zebra", "Camel", "Tower", "Wolf",\r
+ "Hat", "Duck", "Amazon", "Dragon", "Wildebeest", "Lion",\r
+ "Shield", "Pegasus", "Wizard", "Champion", "Helmet",\r
+ "Viking", "Flag", "Axe", "Dolphin", "Leopard", "Tiger",\r
+ "Wheel", "Butterfly", "Promo Bishop", "Promo Rook",\r
+ "Sleeping Beauty", "Reverse Shield", "Prince", "Promo Queen",\r
+ "Promo Lion", "Drunk Elephant", "Reverse Wheel", \r
+ "Tokin", "Promo Knight", "Promo Horse", "Promo Dragon", "Promo Lance",\r
+ "Promo Silver", "Dagger", "Promo Sword", "Promo Dagger", "Princess",\r
"King",\r
"Empty"\r
};\r
ChessSquare p;\r
int i;\r
{\r
- if(i) return pieceToName[(int) p];\r
- return pieceTypeName[(int) p];\r
+ static char buf[MSG_SIZ];\r
+ int black = (p >= BlackPawn);\r
+ if(black) p -= BlackPawn;\r
+ sprintf(buf, i ? black ? "Black " : "White " : "");\r
+ snprintf(buf + strlen(buf), " %s", pieceTypeName[(int) p]);\r
+ return buf;\r
}\r
\r
char* SquareToChar(x)\r
char* SquareToNum(y)\r
int y;\r
{\r
- return squareToNum[y + (gameInfo.boardHeight < 10)];\r
+ return squareToNum[y + (gameInfo.boardHeight != 10)];\r
}\r
\r
\r
int l = strlen(buf);\r
if(appData.debugMode) fprintf(debugFP, "SAY '%s'\n", mess);\r
if(l) buf[l++] = ' '; // separate by space from previous\r
- safeStrCpy(buf+l, _(mess), 8000-1-l); // buffer\r
+ safeStrCpy(buf+l, T_(mess), 8000-1-l); // buffer\r
if(!flag) return; // wait for flush\r
if(p = StrCaseStr(buf, "Xboard adjudication:")) {\r
int i;\r
if(currentPiece != EmptySquare) {\r
char buf[MSG_SIZ];\r
n = boards[currentMove][fromY][1];\r
- snprintf(buf, MSG_SIZ, "%d %s%s", n, PieceToName(currentPiece,0), n == 1 ? "" : "s");\r
+ snprintf(buf, MSG_SIZ, "%d %s%s", n, T_(PieceToName(currentPiece,0)), n == 1 ? "" : "s");\r
SayString(buf, FALSE);\r
}\r
SayString(" ", TRUE);\r
if(currentPiece != EmptySquare) {\r
char buf[MSG_SIZ];\r
n = boards[currentMove][fromY][BOARD_WIDTH-2];\r
- snprintf(buf, MSG_SIZ,"%d %s%s", n, PieceToName(currentPiece,0), n == 1 ? "" : "s");\r
+ snprintf(buf, MSG_SIZ,"%d %s%s", n, T_(PieceToName(currentPiece,0)), n == 1 ? "" : "s");\r
SayString(buf, FALSE);\r
}\r
SayString(" ", TRUE);\r
xchar = SquareToChar(fromX);\r
ynum = SquareToNum(fromY);\r
if(currentPiece != EmptySquare) {\r
- snprintf(buf, MSG_SIZ, "%s %s %s", xchar, ynum, piece);\r
- } else snprintf(buf, MSG_SIZ, "%s %s", xchar, ynum);\r
+ snprintf(buf, MSG_SIZ, "%s %s %s", T_(xchar), T_(ynum), T_(piece));\r
+ } else snprintf(buf, MSG_SIZ, "%s %s", T_(xchar), T_(ynum));\r
SayString(buf, FALSE);\r
SayString(" ", TRUE);\r
}\r
swapColor = piece < (int)BlackPawn && !WhiteOnMove(currentMove) ||\r
piece >= (int)BlackPawn && WhiteOnMove(currentMove);\r
cl.count = 0; cl.rf = fromY; cl.ff = fromX; cl.rt = cl.ft = -1;\r
- GenLegal(boards[currentMove], PosFlags(currentMove + swapColor), ReadCallback, (VOIDSTAR) &cl);\r
+ GenLegal(boards[currentMove], PosFlags(currentMove + swapColor), ReadCallback, (VOIDSTAR) &cl, EmptySquare);\r
if(cl.count == 0) SayString("None", FALSE);\r
SayString("", TRUE); // flush\r
boards[currentMove][fromY][fromX] = victim; // repair\r
victim = boards[currentMove][fromY][fromX]; // put dummy piece on target square, to activate Pawn captures\r
boards[currentMove][fromY][fromX] = WhiteOnMove(currentMove) ? WhiteQueen : BlackQueen;\r
cl.count = 0; cl.rt = fromY; cl.ft = fromX; cl.rf = cl.ff = -1;\r
- GenLegal(boards[currentMove], PosFlags(currentMove+1), ReadCallback, (VOIDSTAR) &cl);\r
+ GenLegal(boards[currentMove], PosFlags(currentMove+1), ReadCallback, (VOIDSTAR) &cl, EmptySquare);\r
if(cl.count == 0) SayString("None", FALSE);\r
\r
SayString("You are defended by", FALSE);\r
\r
boards[currentMove][fromY][fromX] = WhiteOnMove(currentMove) ? BlackQueen : WhiteQueen;\r
cl.count = 0; cl.rt = fromY; cl.ft = fromX; cl.rf = cl.ff = -1;\r
- GenLegal(boards[currentMove], PosFlags(currentMove), ReadCallback, (VOIDSTAR) &cl);\r
+ GenLegal(boards[currentMove], PosFlags(currentMove), ReadCallback, (VOIDSTAR) &cl, EmptySquare);\r
if(cl.count == 0) SayString("None", FALSE);\r
SayString("", TRUE); // flush\r
boards[currentMove][fromY][fromX] = victim; // put back original occupant\r
click-click move is possible */\r
char promoChoice = NULLCHAR;\r
\r
- if (HasPromotionChoice(oldFromX, oldFromY, fromX, fromY, &promoChoice)) {\r
+ if (HasPromotionChoice(oldFromX, oldFromY, fromX, fromY, &promoChoice, FALSE)) {\r
if (appData.alwaysPromoteToQueen) {\r
UserMoveEvent(oldFromX, oldFromY, fromX, fromY, 'q');\r
}\r