* moves.c - Move generation and checking
*
* Copyright 1991 by Digital Equipment Corporation, Maynard,
- * Massachusetts. Enhancements Copyright
- * 1992-2001,2002,2003,2004,2005,2006,2007,2008,2009 Free Software
- * Foundation, Inc.
+ * Massachusetts.
+ *
+ * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006,
+ * 2007, 2008, 2009 Free Software Foundation, Inc.
+ *
+ * Enhancements Copyright 2005 Alessandro Scotti
*
* The following terms apply to Digital Equipment Corporation's copyright
* interest in XBoard:
int SameColor P((ChessSquare, ChessSquare));
int PosFlags(int index);
-extern char initialRights[BOARD_SIZE]; /* [HGM] all rights enabled, set in InitPosition */
+extern signed char initialRights[BOARD_SIZE]; /* [HGM] all rights enabled, set in InitPosition */
int WhitePiece(piece)
/* [HGM] Shogi promotions. '=' means defer */
if(closure->rfIn != DROP_RANK && closure->kind == NormalMove) {
ChessSquare piece = closure->piece;
-#if 0
- if (appData.debugMode) {
- fprintf(debugFP, "Disambiguate A: %d(%d,%d)-(%d,%d) = %d (%c)\n",
- closure->pieceIn,closure->ffIn,closure->rfIn,closure->ftIn,closure->rtIn,
- closure->promoCharIn,closure->promoCharIn);
- }
-#endif
if(c != NULLCHAR && c != 'x' && c != '+' && c != '=' &&
ToUpper(PieceToChar(PROMOTED piece)) != ToUpper(c) )
closure->kind = IllegalMove;
else if(flags & F_WHITE_ON_MOVE) {
-#if 0
- if (appData.debugMode) {
- fprintf(debugFP, "Disambiguate B: %d(%d,%d)-(%d,%d) = %d (%c)\n",
- closure->pieceIn,closure->ffIn,closure->rfIn,closure->ftIn,closure->rtIn,
- closure->promoCharIn,closure->promoCharIn);
- }
-#endif
if( (int) piece < (int) WhiteWazir &&
(closure->rf > BOARD_HEIGHT-4 || closure->rt > BOARD_HEIGHT-4) ) {
if( (piece == WhitePawn || piece == WhiteQueen) && closure->rt > BOARD_HEIGHT-2 ||
closure->kind = IllegalMove;
}
}
-#if 0
- if (appData.debugMode) {
- fprintf(debugFP, "Disambiguate C: %d(%d,%d)-(%d,%d) = %d (%c)\n",
- closure->pieceIn,closure->ffIn,closure->rfIn,closure->ftIn,closure->rtIn,
- closure->promoCharIn,closure->promoCharIn);
- }
-#endif
/* [HGM] returns 'q' for optional promotion, 'n' for mandatory */
if(closure->promoCharIn != '=')
closure->promoChar = ToLower(closure->promoCharIn);