Chess is a game played by two people on a chessboard, with sixteen pieces (of six types) for each player. Each type of piece moves in a distinct way. The goal of the game is to checkmate, that is, to threaten the opponent's king with inevitable capture. Games do not necessarily end with checkmate – players often resign if they believe they will lose. In addition, there are several ways that a game can end in a draw.
Each player controls sixteen pieces.
White moves first, then players alternate moves. Making a move is required; it is not legal to skip a move, even when having to move is detrimental. Play continues until a king is checkmated.
The king moves exactly one square horizontally, vertically, or diagonally. A special move with the king known as castling is allowed only once per player, per game (see below). A rook moves any number of vacant squares in a horizontal or vertical direction. It also is moved when castling. A bishop moves any number of vacant squares in any diagonal direction. The queen moves any number of vacant squares in a horizontal, vertical, or diagonal direction. A knight moves to the nearest square not on the same rank, file, or diagonal. (This can be thought of as moving two squares horizontally then one square vertically, or moving one square horizontally then two squares vertically—i.e. in an "L" pattern.) The knight is not blocked by other pieces: it jumps to the new location.
Pawns have the most complex rules of movement: A pawn moves straight forward one square, if that square is vacant. If it has not yet moved, a pawn also has the option of moving two squares straight forward, provided both squares are vacant. Pawns cannot move backwards. Pawns are the only pieces that capture differently from how they move. A pawn can capture an enemy piece on either of the two squares diagonally in front of the pawn (but cannot move to those squares if they are vacant). The pawn is also involved in the two special moves en passant and promotion.
Castling consists of moving the king two squares towards a rook, then placing the rook on the other side of the king, adjacent to it. Castling is only permissible if all of the following conditions hold: The king and rook involved in castling must not have previously moved; There must be no pieces between the king and the rook; The king may not currently be in check, nor may the king pass through or end up in a square that is under attack by an enemy piece (though the rook is permitted to be under attack and to pass over an attacked square); The king and the rook must be on the same rank.
If a player advances a pawn to its eighth rank, the pawn is then promoted (converted) to a queen, rook, bishop, or knight of the same color at the choice of the player (a queen is usually chosen). The choice is not limited to previously captured pieces. Hence it is theoretically possible for a player to have up to nine queens or up to ten rooks, bishops, or knights if all of their pawns are promoted.
A king is in check when it is under attack by at least one enemy piece. A piece unable to move because it would place its own king in check (it is pinned against its own king) may still deliver check to the opposing player. A player may not make any move which places or leaves his king in check. The possible ways to get out of check are: Move the king to a square where it is not threatened. Capture the threatening piece (possibly with the king). Block the check by placing a piece between the king and the opponent's threatening piece.
If it is not possible to get out of check, the king is checkmated and the game is over . In informal games, it is customary to announce "check" when making a move that puts the opponent's king in check. However, in formal competitions check is rarely announced.