Castling is a single move involving both the king and a rook. Castling king-side moves the king from e1 (e8 for Black) to g1 (g8 for Black) and the rook from h1 (h8 for Black) to f1 (f8 for Black). Castling queen-side moves the king from e1 (e8 for Black) to c1 (c8 for Black) and the rook from a1 (a8 for Black) to d1 (d8 for Black). Castling is only permitted if:
· The king is not in check.
· Neither the king nor the relevant rook has previously moved in the game.
· There are no pieces between the king and the rook.
· None of the squares the king must move across are attacked by an enemy piece or pawn.