Forsyth-Edwards Notation
Encyclopedia
Forsyth–Edwards Notation (FEN) is a standard notation
Chess notation
Chess notation is the term for several systems that have developed to record either the moves made during a game of chess or the position of the pieces on a chess board. The earliest systems of notation used lengthy narratives to describe each move; these gradually evolved into terser systems of...

 for describing a particular board position of a chess
Chess
Chess is a two-player board game played on a chessboard, a square-checkered board with 64 squares arranged in an eight-by-eight grid. It is one of the world's most popular games, played by millions of people worldwide at home, in clubs, online, by correspondence, and in tournaments.Each player...

 game. The purpose of FEN is to provide all the necessary information to restart a game from a particular position.

FEN is based on a system developed by the Scottish
Scotland
Scotland is a country that is part of the United Kingdom. Occupying the northern third of the island of Great Britain, it shares a border with England to the south and is bounded by the North Sea to the east, the Atlantic Ocean to the north and west, and the North Channel and Irish Sea to the...

 newspaper journalist, David Forsyth
David Forsyth (chess)
David Forsyth , a Scotsman who emigrated to New Zealand, served as chess editor of the Glasgow Weekly Herald. Forsyth invented a method for recording chess positions, which he published in the Glasgow Weekly Herald in 1883, now known as Forsyth notation...

. Forsyth's system became popular in the 19th century; Steven J. Edwards extended it to support use by computers. FEN is an integral part of the Portable Game Notation
Portable Game Notation
Portable Game Notation is a computer-processible format for recording chess games ; many chess programs recognize this extremely popular format due to its being stored in plain text.-History:...

 for chess games, since FEN is used to define initial positions other than the standard one. FEN does not represent sufficient information to decide on a draw
Draw (chess)
In chess, a draw is when a game ends in a tie. It is one of the possible outcomes of a game, along with a win for White and a win for Black . Usually, in tournaments a draw is worth a half point to each player, while a win is worth one point to the victor and none to the loser.For the most part,...

 by threefold repetition
Threefold repetition
In chess and some other abstract strategy games, the threefold repetition rule states that a player can claim a draw if the same position occurs three times, or will occur after their next move, with the same player to move. The repeated positions need not occur in succession...

; for that, a different format such as Extended Position Description is needed.

Definition

A FEN "record" defines a particular game position, all in one text line and using only the ASCII character set. A text file with only FEN data records should have the file extension ".fen".

A FEN record contains six fields. The separator between fields is a space. The fields are:
  1. Piece placement (from white's perspective). Each rank is described, starting with rank 8 and ending with rank 1; within each rank, the contents of each square are described from file a through file h. Following the Standard Algebraic Notation
    Algebraic chess notation
    Algebraic notation is a method for recording and describing the moves in a game of chess. It is now standard among all chess organizations and most books, magazines, and newspapers...

     (SAN), each piece is identified by a single letter taken from the standard English names (pawn = "P", knight = "N", bishop = "B", rook = "R", queen = "Q" and king = "K"). White pieces are designated using upper-case letters ("PNBRQK") while black pieces use lowercase ("pnbrqk"). Blank squares are noted using digits 1 through 8 (the number of blank squares), and "/" separate ranks.
  2. Active color. "w" means white moves next, "b" means black.
  3. Castling
    Castling
    Castling is a special move in the game of chess involving the king and either of the original rooks of the same color. It is the only move in chess in which a player moves two pieces at the same time. Castling consists of moving the king two squares towards a rook on the player's first rank, then...

     availability. If neither side can castle, this is "-". Otherwise, this has one or more letters: "K" (White can castle kingside), "Q" (White can castle queenside), "k" (Black can castle kingside), and/or "q" (Black can castle queenside).
  4. En passant
    En passant
    En passant is a move in the board game of chess . It is a special pawn capture which can occur immediately after a player moves a pawn two squares forward from its starting position, and an enemy pawn could have captured it had it moved only one square forward...

     target square in algebraic notation. If there's no en passant target square, this is "-". If a pawn has just made a 2-square move, this is the position "behind" the pawn. This is recorded regardless of whether there is a pawn in position to make an en passant capture.
  5. Halfmove clock: This is the number of halfmoves since the last pawn advance or capture. This is used to determine if a draw can be claimed under the fifty-move rule.
  6. Fullmove number: The number of the full move. It starts at 1, and is incremented after Black's move.

Examples

Here is the FEN for the starting position:

rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

Here is the FEN after the move 1. e4:

rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1


And then after 1. ... c5:


rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPP1PPP/RNBQKBNR w KQkq c6 0 2

And then after 2. Nf3:


rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2

FEN adjustment for chess variants like Chess960

FEN notation is critical for recording games in chess variants such as Chess960
Chess960
Chess960 is a chess variant invented and advocated by former World Chess Champion Bobby Fischer, originally announced on June 19, 1996 in Buenos Aires, Argentina. It employs the same board and pieces as standard chess, but the starting position of the pieces is randomized along the players' home...

 (also known as Fischer Random Chess), where the initial position is not necessarily the traditional initial position. However, the FEN castling availability encoding (KQkq) is inadequate for positions in which there are two Rooks on the same side of the King on the back rank. It is ambiguous which Rook is still available for castling without knowing their initial positions.

The solution implemented by chess engines like Shredder and Fritz_9 is to use the letters of the columns on which the rooks began the game. This scheme is sometimes called Shredder-FEN. For the traditional setup, Shredder-FEN would use AHah instead of KQkq.

Another solution is offered by X-FEN
X-FEN
X-FEN is an extension of Forsyth-Edwards Notation .The traditional Forsyth-Edwards Notation is not sufficient to represent all possible positions in 8x8 Chess960 or 10x8 Capablanca random chess . Consequently, an extension of FEN was needed, with the requirement of being fully backward compatible...

, which offers more backward compatibility than does Shredder-FEN, but at the cost of more complexity.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK