home *** CD-ROM | disk | FTP | other *** search
- #ifndef __SOLUTION_H__
- #define __SOLUTION_H__
-
- // Do not modify this file
-
- #include <MacTypes.h>
- #include <Files.h>
-
- #ifdef __cplusplus
- extern "C" {
- #endif // __cplusplus
-
- typedef enum {kEmpty=0,kWhite,kBlack} PieceColor;
- typedef enum {kNone=0,kPawn,kKnight,kBishop,kRook,kQueen,kKing} PieceRank;
-
- typedef struct Square {
- UInt16 row; /* 0..7, white initially occupies rows 0 and 1, black 7 and 6 */
- UInt16 col; /* 0..7, white king starts at (row,col) == (0,4) */
- } Square;
-
- typedef struct ChessMove {
- Square fromSquare;
- Square toSquare;
- Boolean capture;
- Square capturedSquare; /* valid only if capture==TRUE */
- } ChessMove;
-
- typedef struct ChessPiece {
- PieceColor whichColor;
- PieceRank whichRank;
- Square pieceLocation;
- } ChessPiece;
-
- pascal void FindLegalChessMoves(
- UInt32 numPriorMoves,
- ChessMove priorMoves[],
- UInt32 *numPiecesRemaining,
- ChessPiece piecesRemaining[],
- UInt32 *numLegalMoves,
- ChessMove legalMoves[]
- );
-
- #ifdef __cplusplus
- }
- #endif // __cplusplus
-
- #endif // __SOLUTION_H__