The Chess Variant Pages

Fairy Forsythe Edwards Notation

This document describes an extension of the well known Forsythe Notation for describing setups on a chessboard - that notation is also known as the Forsythe Edwards Notation. This extension, called Fairy Forsythe Edwards Notation, abbreviated as FFEN, is meant to describe setups on a chessboard, possibly of different sizes and shapes, and possibly with non-standard chess pieces.

The FFEN was proposed in March 1998 by Hans Bodlaender, and used in a tool to for publishing fairy chess diagrams programmed by Andy Kurnia.

This document describes FFEN version 0.02.

Limitations

The current form of the FFEN can only be used to describe diagrams for (one- or) two-dimensional chess variants, with pieces standing on squares. All fields should be equally sized squares or rectangles. In particular, this means that the current version of the FFEN is not meant to describe setups for three-dimensional chess variants, for variants on hexagonal or circular boards, and for games like Xiangqi where pieces stand on intersection lines.

Also, a shorthand notation for multiple empty lines used in the FEN is not available. In FEN, one could e.g. describe three successive empty rows (of eight squares each) as /24/; in the FFEN one should write /8/8/8/. (See for details below.)

Extensions to FEN

FFEN has a number of extensions to the FEN. It is possible to describe setups on boards of a size different from 8 by 8, to describe boards where not all squares are present, to use pieces different from king, queen, rook, knight, bishop, or pawn, and to use pieces (standard or non-standard) of colors different from white and black.

Description of the FFEN

The FFEN is a description of a setup of chess or fairy chess pieces on a board made of squares, arranged as a subset of squares in a grid.

The setup is described row by row, starting at the upper row, i.e. the first row at Black's side, which is the last row seen from White's side. Each row description is separated by a slash (/) symbol.

A row description gives the contents of a row from left to right, seen from White's side. The contents of the squares are given successively, with consecutive empty squares described together.

The following row description elements exist:

Options

At the start of the FFEN-string, options can be added. The current version of FFEN supports the following options:

If neither the W or U option is in effect, the board is checkered with a black square in the lower left corner.

Examples


FFEN-to-HTML

FFEN-to-HTML is a tool that helps to make html-code that displays a (fairy) chess setup, given in FFEN. It can be used in collection with a set of gif-files (or picture files in other formats supported by browsers, like jpeg); each giving a single square of a (fairy or standard) chess board with possibly a (fairy or standard) chess piece on it.

The program runs under 32-bit Windows. You need file: VB40032.DLL. You can download this file from elsewhere on the WWW. Put this file in the c:/windows/system folder.

This tool is Freeware. Copyright rests by Andy Kurnia, but you may use it without fee. That, of course, also implies that you have no right to any support of any kind. Use it as it is, and at your own risk, although no bugs or problems are known to us. Comments are welcome, and could be send to Andy Kurnia or Hans Bodlaender.

The tool gets as input a FFEN-string, and a string that describes how the conversion to HTML should be made. The html-code can be sent to the clipboard, and optionally Notepad can be launched with it.

The following filenames are used:

Detailed description

You'll get a dialog box like the one below:

[ ]: The system menu (the control menu). It has "minimize", "move"
    as well as "close" (alt+f4).

FFEN: (Alt+F) This should contain your FFEN. Supported are:

    {W} --> should be the first 3 chars and should be with uppercase W
    {U} --> should be the first 3 chars and should be with uppercase U
    P, p --> single-letter pieces (WHITE, black)
    12 --> positive integers: number of vacant squares
    (Piece), (piece) --> multi-letter pieces; (p) = p; (White, black)
    (Piece3), (piece3) --> multi-letter pieces with the B value (the piece
        color) determined. In determining this, the LAST char is checked
        and should be a digit.
    - --> squareless (x.gif)

Syntax: (Alt+S) This defines how a square is translated to.
    %% is replaced with a single %
    %f is replaced by the proposed filename (no extension!)
    %s is replaced by the piece's name (or nothing for - or spaces)
    (only %f and %s work, %F and %S do not work)

Notepad: (Alt+N) (Enter) This default button puts the HTML code to the
    clipboard, fires up Notepad and presses Shift+Insert there (i.e.
    paste the HTML code to the new Notepad window).

Clipboard: (Alt+C) This button puts the HTML code to the clipboard --
    that's all.

Exit: (Alt+X) (Esc) (Alt+F4) This button exits the program.

Implementation Notes

Zero's at the start of an integer are ignored, so 007 has the same effect as 7, and 010 has the same effect as 10.

"%f" = "xC", "%s" = ""

- (hyphen): squareless. "%f" = "x", "%s" = ""

P (or any non-X UPPERCASE letter): white piece (single letter). "%f" = "p0C", "%s" = "P" (C = square color)

p (or any non-x lowercase letter): black piece (single letter). "%f" = "p1C", "%s" = "p"

(xyzabc): white piece --> "%f" = "xyzabc0C", "%s" = "xyzabc"
(xYzAbC): white piece (because it's still lowercase 'x') --> "%f" = "xyzabc0C", "%s" = "xYzAbC"

(Xyzabc): black piece --> "%f" = "xyzabc1C", "%s" = "Xyzabc"
(XYZABC): black piece --> "%f" = "xyzabc1C", "%s" = "XYZABC"

(xyzabc8): "%f" = "xyzabc8C", "%s" = "xyzabc8", etc. (8 can be any number)

(): ignored

(-): these are also x (squareless)!
(p), (P): same as p or P

@: (or any unknown symbol) are considered 0 (vacant square)

($fD): 1st char non-uppercase so it's a black piece: "%f" = "$fd1C", "%s" = "$fD"

/: translated to <BR>
only <BR>, no extra newline (all the HTML code is on one line)

You must manually check that all rows (separated by /) have the same number of columns.

The number of /'s (as well as the presence or absence of {W}) determine C (square color).

If {U} is used, square color is always 2. If {W} is used, lower-left is 0 (white). Then it's checkered using 1 and 0. Otherwise lower-left is 1 (black). It's checkered using 0 and 1.

Tips

Use the Syntax: to determine WIDTH=, HEIGHT=, the presence of ALT= (and what it contains), the path (e.g. "../"), the extension (e.g. ".gif"), etc.

Both FFEN: and Syntax: support standard text editing! (All Windows textboxes do.) This includes: Undo/Cut/Copy/Paste with Ctrl+Z/Ctrl+X/Ctrl+C/Ctrl+V, Undo/Cut/Copy/Paste/Delete with Alt+BackSpace/Shift+Del/Ctrl+Ins/Shift+Ins/Del, and Undo/Cut/Copy/Paste/Delete/Select All in the pop-up menu (right-click the textbox, or Shift+F10, or use the MENU key on keyboards designed for Win95).

You can press Esc to exit the program.

Using "Notepad" also copies the HTML code to the clipboard. (You can use File/Save As... in Notepad!)

You can minimize the program. Use the menu you get with Alt+Spacebar (it's the system menu, or control menu).

You can close the program with many ways. These are the ways using the program itself:

In addition you can use Ctrl+Alt+Del and push End Task, but that's cruel ;-)


Written by Hans Bodlaender and Andy Kurnia.
WWW page created: March 10, 1998. Last modified: May 29, 1999.