As you maybe know,
Chess is a board game played between two players. It is played on a chessboard, which is a square-checkered board with 64 squares arranged in an eight-by-eight grid. At the start, each player controls sixteen pieces: one king, one queen, two rooks, two knights, two bishops, and eight pawns. The object of the game is to checkmate the opponent's king, whereby the king is under immediate attack (in "check") and there is no way to remove or defend it from attack on the next move.
The board has eight rows (called ranks and denoted with numbers 1 to 8) and eight columns (called files and denoted with letters a to h).
White always moves first. After the initial move, the players alternately move one piece at a time (with the exception of castling, when two pieces are moved). Pieces are moved to either an unoccupied square, or one occupied by an opponent's piece, capturing it and removing it from play. With the sole exception of en passant, all pieces capture opponent's pieces by moving to the square that the opponent's piece occupies. (In this problem, there will not be ‘en passant’, ‘Castling’ or ‘Promotion’. This simplifies the problem a little.)
Each chess piece has its own style of moving.
● The king moves one square in any direction. The king has also a special move which is called castling and also involves a rook, but
not in this problem!
● The rook can move any number of squares along any rank or file, but may not leap over other pieces. Along with the king, the rook is also involved during the king's castling move, but
not in this problem!
● The bishop can move any number of squares diagonally, but may not leap over other pieces.
● The queen combines the power of the rook and bishop and can move any number of squares along rank, file, or diagonal, but it may not leap over other pieces.
● The knight moves to any of the closest squares which are not on the same rank, file or diagonal, thus the move forms an "L"-shape two squares long and one square wide. The knight is the only piece which can leap over other pieces.
● The pawn may move forward to the unoccupied square immediately in front of it on the same file, or on its first move it may advance two squares along the same file provided both squares are unoccupied, or it may move to a square occupied by an opponent’s piece, which is diagonally in front of it on an adjacent file, capturing that piece. The pawn has two special moves, the en passant capture, and pawn promotion, but
not in this problem! Just as you see, the white pawn move upward and the black pawn move downward.
A player may not make any move which allows the
King to be captured. If such a move is not possible, the game ends. The result will be a checkmate, if king is under immediate attack or stalemate, if it is not. -----Wikipedia.
The question your program should answer is when a player makes a move, determine the result of the move. The result can be one of these,
Checkmate! -----------------This move result a win.
Draw -------------------------This move result a stalemate
Check! -----------------------The game has not finished yet, but this move is a check
Just a normal move --------The game has not finished yet, and this move is not a check
This is not a legal move --This is happened when move a piece not belongs to it, want to eat a piece belongs to it, want to move a piece not under the style of that kind of piece, when you under check that move is not a right response or after that move you king will be capture.