Friends scan this code to open Chess on their phone.
How to play
The goal
Each side has 16 pieces. White moves first, then the players take turns, one move each.
Win by checkmate: attack the enemy king so that it has no way out of the attack.
How the pieces move
King: one square in any direction. It may never move into check.
Queen: any distance in a straight line or along a diagonal.
Rook: any distance along a rank or file. Bishop: any distance along a diagonal.
Knight: an L-shape (two squares one way, then one to the side). It is the only piece that jumps over others.
Pawn: one square forward, or two from its starting square. It captures one square diagonally forward.
Pieces capture by moving onto an enemy piece. Only the knight may jump; every other piece needs a clear path.
Special moves
Castling: the king moves two squares towards a rook and the rook jumps to the other side of it. Allowed only if neither piece has moved, the squares between are empty, and the king is not in check, does not pass through an attacked square and does not land in check. To castle, move the king two squares.
En passant: if a pawn moves two squares and lands beside an enemy pawn, that pawn may capture it as if it had moved one square, but only on the very next move.
Promotion: a pawn that reaches the far rank becomes a queen, rook, bishop or knight of your choice.
How games end
Checkmate wins. A player can also resign, or lose on time when the clock is on.
Draws: stalemate (the player to move has no legal move but is not in check), threefold repetition of the same position, the fifty-move rule (50 moves each with no capture and no pawn move) and insufficient material (for example king against king and bishop). These draws are applied automatically.
If a clock runs out but the other side cannot possibly checkmate (a lone king, or king and one bishop or knight), the game is a draw.
Controls
Tap a piece to see where it can go: dots mark empty squares and rings mark captures. Tap a marked square to move, or drag the piece there.
Undo takes back your last move (and the computer's reply). Hint shows a good move with an arrow. Resign ends the game.
Modes
vs Computer: play White, Black or a random side. Easy looks one or two moves ahead and makes mistakes, Medium looks about three moves ahead, Hard searches deeper for up to 1.5 seconds per move.
2 players: share one device. Turn on flip board each turn to always show the board from the side of the player to move.
The optional clock gives each side 5 or 10 minutes for the whole game. It starts after White's first move.