chess:programming:fen_forsyth-edwards_notation
Chess - Programming - FEN (Forsyth-Edwards Notation)
FEN is a standard notation for describing a particular board position of a chess game.
- The purpose of FEN is to provide all the necessary information to restart a game from a particular position.
The starting position:
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
NOTE: A FEN record contains six fields, separated by spaces.
The fields are:
- Piece placement.
- rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR: The Piece Placement.
- /: The next rank.
- Digits 1-8: The number of empty squares until the next piece on the rank.
- Active color:
- w means White moves next,
- b means Black moves next.
- Castling availability.
- -: Neither side can castle.
- K: White can castle kingside,
- Q: White can castle queenside,
- k: Black can castle kingside,
- q: Black can castle queenside.
- En passant target square in algebraic notation:
- -: There is no en passant target square.
- This is recorded regardless of whether there is a pawn in position to make an en passant capture.
- Halfmove clock: The number of halfmoves since the last capture or pawn advance, used for the fifty-move rule.
- Fullmove number: The number of the full move. It starts at 1, and is incremented after Blacks move.
Test Enpassant capture gives check
Test Long castling gives check
Test Short castling gives check
Test Underpromotion gives check
References
chess/programming/fen_forsyth-edwards_notation.txt · Last modified: 2021/11/15 20:55 by peter