COPYRIGHT: 28 Nov 2009, Charles Cadman. All rights reserved under U.S. copyright law and applicable treaties, except as indicated below under license. LICENSE: This code may be used for any purpose under the following condition. If the code or any modification or extension of the code is distributed, (1) the same license must apply to the distributed code, and (2) the copyright to the original code must be acknowledged. DISCLAIMER OF WARRANTY: The code is provided "as is" without any warranty expressed or implied. The author is not responsible for any loss or damage resulting from use of the code. COMPILERS: This code compiles under Visual C++ 2008 Express Edition in console mode with precompiled headers turned off. I expect it to compile with any current compiler. DESCRIPTION: This code provides classes that can keep track of a chess position while a game is being played. It recognizes the standard algebraic notation as well as coordinate notation and Forsyth-Edwards notation (FEN). It can generate all legal moves in a position. All the code (except for chess.cpp) lives in namespace ChessRules. CLASSES: Color - either white or black Square - any square on the chessboard SquareOffset - mathematicians should think 'vector.' It stores the difference between two squares. f7 - f8 is the same as g7 - g8. Piece - a chess piece together with its color. It knows how the piece moves if you tell it what square it's on, and it tells you what path it needs to take to reach the squares it could legally move to if no other pieces were on the board. Board - an abstract base class. A Board knows where the pieces are located, whose move it is, whether en passant or castling is possible, how many moves have been made since the last pawn move or capture, and the move number. It can spit out its representation in FEN. TextBoard - an implementation of Board which uses a map. It is called TextBoard, because the only way to view a TextBoard is via std::cout. GamePosition - a legal game position in which moves can be made. Allows moves to be made via mutator functions which check that the move is legal before making the move. Move - a move in a chess game. It "remembers" the algebraic and coordinate notations of the move, together with the GamePosition which results from the move. A Move can be specified using algebraic notation. It must be legal and unambiguous. FUNCTIONS: vector AllLegalMoves(const GamePosition&) generates all legal moves in a position. std::ostream& operator<<(std::ostream&, const Board&) prints a board to the console. The use of this code is illustrated in chess.cpp.