This page contains the shared data structures and associated constants that will be passed back and forth between modules.
- chess_board: this is the biggie, the data structure which describes the chess board itself and handles all operations on it, including moves. Following are the associated constants/data types:
- boardSize: currently 8, but you should use this constant for the size of the chess board everywhere in your code. (That way we can change the board size easily if we have to.)
- pieceColor: describes the color of a piece; equals either whitePiece or blackPiece.
- pieceKind = oneof[king,queen,rook,bishop,knight,pawn: null]
- undoMoveInfo: returned by chess_board$make_move, contains data that the program uses to undo the move. You don't need to know what's inside!
- moveData = struct[fromrow,fromcol,torow,tocol: int]
- describes a move from (fromrow,fromcol) to (torow,tocol)
- note that row and col #'s start at 1 in the lower-left corner of the board
- teleportState = oneof[off:null, on: teleportSpots]
- describes whether or not the current chess board allows "teleporting"
- teleportSpots = struct[r1,c1,r2,c2:int]
- (r1,c1) and (r2,c2) are the rows and columns of the two "teleport" locations on the chess board. When a piece lands on one of these spots, it is "teleported" to the other spot.