===The end of the game===
The game ends either with one player winning by checkmating his opponent's king, or by the loser resigning, signified by toppling his king over instead of moving, or in a draw with neither player winning.
Checkmate is achieved when the following conditions are met.
* The King is directly attacked by an opponent's piece.
* Every square that the King can move to is also attacked by an opponent's piece.
* The Piece that is attacking the King cannot be captured.
* Another Piece cannot be
moved in between to cut off the attack on the King.When the King is checkmated, The game is over, and the player who checkmated the other player's king is the winner.
There are several ways that the game can end in a draw.
One of these is stalemate, which is described below. Additionally, the players can mutually agree to a draw, or a draw can be claimed if each player has made fifty consecutive moves without a pawn move or a capture, or if the same position has appeared on the board three times. =====Stalemate===== A player is stalemated when he cannot make a legal move , and is not in check.