[SGF FF[4] - Smart Game Format] last updated: 2021-12-01

Hex (GM[11])

Implementation of SGF FF[4] for Hex

See this page for a Javascript Hex SGF library; or visit the HexWiki for more information.

All (game-specific) property values are case insensitive.

The default board size is 11 x 11. The minimum size for a row or a column is 1. If a board is asymmetric, the SZ[] property should specify [number_of_columns : number_of_rows] in line with the SGF FF[4] specification.

Black tries to connect the top and bottom of the board; White tries to connect the left and right sides.

The default first player is Black.

Point and Move types

Point

[ board ]
Cells on the board are labeled with letters for the columns and numbers for the rows, as shown. A cell is identified by the letter of its column, followed by the number of its row. Examples: [a1], [g5], [d11].

If there are more than 26 columns, they are identified by base-26 alphabet numbers, i.e., the next columns after z are aa, ab, ac, ..., az, ba, bb, and so on. The next column after zz is aaa.

Column labels are case insensitive. Examples: [a1], [G5], [D11], [aA27], [AB6].

Move

Normal moves specify the cell, as defined by point type above. Moves should be legal; there is no defined behaviour upon reading an illegal move, except to display an error message.

Example normal moves: B[e4], W[F9].

The following moves are special:

Both swap methods are equivalent in play terms. A swap move may occur at any node, although normally it is restricted to the second move. The rules agreed for a game may be defined using the RU[] property.

Example special moves: B[resign], W[swap-pieces], B[forfeit].

Properties

Property:	IS
Propvalue:	list of composed SimpleText ':' SimpleText
Propertytype:	root
Function:	This property allows applications to store and read
		an initial viewer setting. The property value is a list of
		"keyword followed by ':' followed by either 'on' or 'off'".
		Valid keywords are:
		  'tried' - identify future moves that have been tried?
		  'marked' - show good/bad move markings?
		  'lastmove' - identify the last cell played?
		  'headings' - display column/row headings (a b.., 1 2..)?
		  'lock' - lock the game against new moves (for analysis)?
		This property is allowed in the root node only.
		Example: IS[tried:on][lock:off][marked:off]

Property:	IP
Propvalue:	SimpleText
Propertytype:	game-info
Function:	Designates the initial position that the viewer
		should display. It will most frequently indicate the
		current position of play in the game. This is necessary 
		because future possible moves may have been explored,
		and the user must be able to distinguish real moves
		actually made from exploratory moves. More than one IP[]
		property in a game is illegal, and the behaviour undefined.
		The property value should be empty (""); it is specified
		as SimpleText for compatibility.