Changes

Jump to: navigation, search

Algebraic Chess Notation

18,635 bytes added, 10:33, 9 May 2018
Created page with "'''Home * Chess * Game * Algebraic Chess Notation''' '''Algebraic Chess Notation''' is a chess notation to record and represent Moves|moves..."
'''[[Main Page|Home]] * [[Chess]] * [[Chess Game|Game]] * Algebraic Chess Notation'''

'''Algebraic Chess Notation''' is a chess notation to record and represent [[Moves|moves]] of a [https://en.wikipedia.org/wiki/Human-readable_medium human readable] [[Game Notation|game notation]]. It is based on a system developed by [https://en.wikipedia.org/wiki/Philipp_Stamma Philipp Stamma] to notate the [[Target Square|target square]] by [[Squares#Algebraic|algebraic coordinates]], and various forms to represent the [[Origin Square|origin square]] of the move, either by language dependent [https://en.wikipedia.org/wiki/Algebraic_chess_notation#Naming_the_pieces_in_various_languages piece initials] and/or [[Files|file]], [[Ranks|rank-]] or [[Squares|square]] notation of the from- or origin square. [[Promotions]] must be disambiguated by including the promoted piece type, and [[Castling|castling]] usually has their own symbol strings ('O-O', 'O-O-O'). Some format variations also specify a [[Captures|captured]] piece, if any, for the purpose to make the notation reversible, and to go backward as easy as forward while re-playing a game.

=Sequence of Moves=
Chess programs need to convert the [[Move List|list]] of [[Encoding Moves|encoded moves]] into a sequence of printable strings, or to render them inside a [[GUI#NotationWindow|notation window]]. The move number of the game, starting by '1.' from the [[Initial Position|initial position]], is prefix of the white halfmove, followed by a the black reply, often in a second column of a grid view. If a move notation starts with Black, also after embedded comments or annotations, a trailing [https://en.wikipedia.org/wiki/Ellipsis ellipsis] is used instead of a single dot.
<pre>
<move> ::= <move number><move descriptor>
<move number> ::= <digit>[<digit>...]{'.' | '...'}
</pre>

Modern chess programs, and their [[GUI|graphical user interface]] often support various modes to represent all kinds of game and move notations. Regarding [[Entering Moves|input of moves]] from a [[User Interface|user interface]], or reading moves from text files, programs needs to parse strings accordantly.
<span id="PureCoordinateNotation"></span>
=Pure coordinate notation=
Considering the common From-To [[Encoding Moves|move encoding]] inside a chess program, pure coordinate notation is a straight-forward chess notation to use only algebraic From- and To-coordinates. This notation omits any machine redundant piece letters for the moving and/or capturing pieces, and only has to specify the promoted piece as trailing [https://en.wikipedia.org/wiki/Algebraic_chess_notation#Naming_the_pieces_in_various_languages letter] in case of [[Promotions|promotions]].

<pre>
<move descriptor> ::= <from square><to square>[<promoted to>]
<square> ::= <file letter><rank number>
<file letter> ::= 'a'|'b'|'c'|'d'|'e'|'f'|'g'|'h'
<rank number> ::= '1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'
<promoted to> ::= 'q'|'r'|'b'|'n'
</pre>

Pure algebraic coordinate notation was often used in early microcomputer chess programs, sometimes even with capital file letters. Some programs used a hyphen or 'x' delimiter between the coordinate substrings to distinguish [[Quiet Moves|quiet moves]] from [[Captures|captures]] in move outputs. While not common in human chess notation, pure coordinate notation has the advantage to avoid any ambiguity and is further easy convertible from a move list without the need of retrieving information from internal [[Board Representation|board representations]], (i.e. which [[Pieces|pieces]] occupy which squares). Even [[Castling|castling]] was often written as E1G1 or E1C1 instead of 'O-O' or 'O-O-O'.

==XBoard==
Per default, the [[Chess Engine Communication Protocol]] requires pure algebraic coordinate notation without from-to delimiters as input and output move format <ref>[http://home.hccnet.nl/h.g.muller/engine-intf.html#8 Chess Engine Communication Protocol: 8. Commands from xboard to the engine]</ref> .

==UCI==
The [[UCI]] communication protocol requires ''pure algebraic coordinate notation'' without from-to delimiters as well. Inside its specification the UCI move format is called "long algebraic notation" <ref>[http://www.shredderchess.com/chess-info/features/uci-universal-chess-interface.html The UCI Specification]</ref> , which might be considered slightly incorrect concerning leading piece character and dash or hyphen between from- and to coordinates, see LAN definition below.

==Output Samples==
{|
|-
| [[FILE:8080Chess.JPG|none|border|x280px|text-bottom]]
!
| [[FILE:c64_kempelen_emulator_scr2.gif|none|border|x280px|text-bottom|link=http://www.spacious-mind.com/html/c64_emu_-_kempelen.html]]
|-
| [[8080 Chess]] Display <ref>''Processor Technology 8080 CHESS User's Manual''. [http://www.sol20.org/manuals/chess.pdf pdf], [http://www.imsai.net/support/processor_tech/chess.pdf pdf]</ref>
!
| [[Kempelen]] [[Move List|move list]] <ref>[http://www.spacious-mind.com/html/c64_emu_-_kempelen.html Kempelen Chess from Sierra Online] from [[The Spacious Mind]]</ref>
|}

==ICCF numeric notation==
The language independent [https://en.wikipedia.org/wiki/ICCF_numeric_notation ICCF numeric notation] as used in [https://en.wikipedia.org/wiki/Correspondence_chess Correspondence chess] is a numerical pure coordinate notation, giving coordinates by two digits (File '1'-'8) rather than letters ('a'-'h') for the file. In case of promotions a fifth trailing digit is used: '1' for queen, '2' for rook, '3' for bishop and '4' for knight.
<span id="Smith"></span>
==Smith notation==
The Smith notation designed by [[Warren D. Smith]] <ref>[https://www.chessclub.com/chessviewer/smith.html Smith notation]</ref> , as used in the [[Internet Chess Club]] chess server, encodes moves with from-square, to-square, and to make it reversible, so it is as easy to go backwards in a game as forwards, what piece was captured, if any:

<pre>
<Smith move descriptor> ::= <from square><to square>[<capture indicator>][<promoted to>]
<capture indicator> ::= 'P' | 'N' | 'B' | 'R' | 'Q'
</pre>
<span id="LAN"></span>
=Long Algebraic Notation (LAN)=
Beside the already sufficient and unambiguous pure origin- and target-coordinates, LAN uses a leading redundant, national dependent uppercase [https://en.wikipedia.org/wiki/Algebraic_chess_notation#Naming_the_pieces_in_various_languages piece letter] or figurine piece symbol of the moving piece usually other than a [[Pawn|pawn]], to represent the move, which makes it more [https://en.wikipedia.org/wiki/Human-readable_medium human readable] and compatible with SAN and [https://en.wikipedia.org/wiki/Descriptive_chess_notation desciptive notation]. However, for chess programs using pure from-to move encoding, converting the move list to LAN already requires a board representation in sync with the leading moves already played, to lookup the piece on the board.

<pre>
<LAN move descriptor piece moves> ::= <Piece symbol><from square>['-'|'x']<to square>
<LAN move descriptor pawn moves> ::= <from square>['-'|'x']<to square>[<promoted to>]
<Piece symbol> ::= 'N' | 'B' | 'R' | 'Q' | 'K'
</pre>
''English symbols [[Knight]], [[Bishop]], [[Rook]], [[Queen]] and [[King]]''.

{|
|-
| [[FILE:ChessForAndroid_a_chess.png|none|border|text-bottom|link=@http://www.aartbik.com/MISC/android.html]]
|-
| [[Aart Bik|Aart Bik's]] [[Chess for Android]], G1 version with LAN representation <ref>[http://www.aartbik.com/MISC/android.html Aart's Android Page]</ref>
|}
<span id="SAN"></span>
=Standard Algebraic Notation (SAN)=
Standard algebraic notation (SAN) is the official notation of the [[FIDE]] which must be used in all recognized international competition involving human players <ref>[http://www.fide.com/component/handbook/?id=171&view=article FIDE handbook, Laws of Chess - Appendix C. Algebraic notation]</ref> . Concerning computer chess, SAN is a representation standard for chess moves inside the [[Portable Game Notation]] standard using the [https://en.wikipedia.org/wiki/ASCII ASCII] [https://en.wikipedia.org/wiki/ISO/IEC_8859-1 Latin alphabet] <ref>[http://www.thechessdrum.net/PGN_Reference.txt Standard: Portable Game Notation Specification and Implementation Guide] by [[Steven Edwards]] - 8.2.3: Movetext SAN (Standard Algebraic Notation)</ref>, and should be supported as default notation by all modern chess programs and their user interfaces <ref>[http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/areas/games/chess/san/ SAN Kit: Implemented Standards for Chess Move Notation] by [[Steven Edwards]]</ref>.

{|
|-
| [[FILE:ChessForAndroid_a_chess.png|none|border|text-bottom|link=@http://www.aartbik.com/MISC/android.html]]
|-
| [[Aart Bik|Aart Bik's]] [[Chess for Android]], latest version in SAN mode <ref>[http://www.aartbik.com/MISC/android.html Aart's Android Page]</ref>
|}

While otherwise similar to LAN, SAN suppresses redundant information concerning the from-square, while keeping the descriptive letter or symbol of pieces other than a pawn. SAN further suppresses the from-to hyphen, and in some variations also the capture indicator 'x' (or ':').
<pre>
<SAN move descriptor piece moves> ::= <Piece symbol>[<from file>|<from rank>|<from square>]['x']<to square>
<SAN move descriptor pawn captures> ::= <from file>[<from rank>] 'x' <to square>[<promoted to>]
<SAN move descriptor pawn push> ::= <to square>[<promoted to>]
</pre>

==Ambiguities==
If the piece is sufficient to unambiguously determine the origin square, the whole from square is omitted. Otherwise, if two (or more) pieces of the same kind can move to the same square, the piece's initial is followed by (in descending order of preference)
# file of departure if different
# rank of departure if the files are the same but the ranks differ
# the complete origin square coordinate otherwise
<span id="Captures"></span>
==Captures==
[[Captures]] are denoted by the lower case letter "x" immediately prior to the destination square. Pawn captures with the omitted piece symbol, include the file letter of the originating square of the capturing pawn prior to the "x" character, even if not required for unambiguousness. Some SAN variations in printed media even omit the target rank if unambiguous, like dxe, which might not be accepted as input format.
<span id="Enpassant"></span>
==En passant==
The PGN-Standard does not require [[En passant]] captures have any special notation, and is written as if the captured pawn were on the capturing pawn's destination square.[[FIDE]] states the redundant move suffix "e.p." optional (after 1 July 2014) <ref>[http://www.fide.com/component/handbook/?id=171&view=article FIDE handbook, Laws of Chess - Appendix C. Algebraic notation, C-9]</ref>.

In the case of an ‘en passant’ capture, ‘e.p.’ may be appended to the notation.
<span id="Promotions"></span>
==Pawn promotion==
A [[Promotions|pawn promotion]] requires the information about the chosen piece, appended as trailing Piece letter behind the target square. The SAN PGN-Standard requires an equal sign ('=') immediately following the destination square.
<span id="Castling"></span>
==Castling==
[[Castling]] is indicated by the special notations, "O-O" for kingside castling and "O-O-O" for queenside castling. While the FIDE handbook <ref>[http://www.fide.com/component/handbook/?id=171&view=article FIDE handbook, Laws of Chess - Appendix C. Algebraic notation - C.13 Abbreviations]</ref> uses the digit zero, the SAN PGN-Standard requires the capital letter 'O' for its export format.

==Converting Moves==
Due to the most compact representation, considering ambiguities concerning the origin square, converting moves with pure from- and to-squares to SAN requires not only an underlying board representation to determine piece initials, but also [[Move Generation#Legal|legal move generation]] for a subset of moves to the destination square. [[Pseudo-Legal Move|Pseudo legal]], but [[Legal Move|illegal moves]] for instance with a [[Pin|Pinned piece]] must not be considered in ambiguous issues in an export format.

==XBoard 2==
With the [[Chess Engine Communication Protocol]] version 2, one can use the feature command to select SAN as move format for both input and output <ref>[http://home.hccnet.nl/h.g.muller/engine-intf.html#9 Chess Engine Communication Protocol: 9. Commands from the engine to xboard]</ref> .
<span id="FAN"></span>
=Figurine Algebraic Notation (FAN)=
Figurine notation uses miniature piece icons instead of single letter piece abbreviations. This enables the moves to be read independent of the language. The [https://en.wikipedia.org/wiki/Unicode Unicode] [https://en.wikipedia.org/wiki/Miscellaneous_Symbols_Unicode_block Miscellaneous Symbols] set includes all of the [https://en.wikipedia.org/wiki/Chess_symbols_in_Unicode symbols] necessary for FAN if appropriate [https://en.wikipedia.org/wiki/Font fonts] were installed on the computer <ref>[http://www.talkchess.com/forum/viewtopic.php?t=38318 Unicode values for chessmen] by [[Steven Edwards]], [[CCC]], March 07, 2011</ref> . [[GUI|Chess GUIs]] may alternatively use [https://en.wikipedia.org/wiki/Scalable_Vector_Graphics Scalable Vector Graphics] or other scalable 2D [https://en.wikipedia.org/wiki/Vector_graphics Vector Graphics] to render the symbols inside their views.

==Vector Graphics==
{|
|-
| [[FILE:IsiChessFigurine.JPG|none|border|text-bottom]]
|-
| [[IsiChess]], notation window with figurine LAN, using 2D [https://en.wikipedia.org/wiki/Vector_graphics Vector Graphics], see [[2D Graphics Board#Drawing|sample code]]
|}

==LaTeX==
{|
|-
| [[FILE:LaTeXChessNotation.JPG|none|border|text-bottom|785px]]
|-
| FAN in [https://en.wikipedia.org/wiki/LaTeX LaTeX] <ref>[http://goossens.web.cern.ch/goossens/ Michel Goossens], [http://www.informit.com/authors/bio.aspx?a=A2624A62-C2B4-40F9-B8ED-E99563F89A27 Frank Mittelbach], [http://users.ox.ac.uk/%7Erahtz/ Sebastian Rahtz], [http://www.loria.fr/%7Eroegel/ Denis Roegel], [http://www.uit.co.uk/Authors/HerbVoss Herbert Voß] ('''2007'''). ''[http://xml.web.cern.ch/XML/lgc2/ The LATEXGraphics Companion]''. Second Edition, Addison-Wesley, ISBN-13: 978-0-321-50892-8, [http://ptgmedia.pearsoncmg.com/images/9780321508928/samplepages/0321508920_Sample.pdf sample pdf], 10.1 Chess, 10.2 Xiangqi—Chinese Chess</ref>
|}
<span id="ReadingChess"></span>
=Reading Chess=
In an attempt of [https://en.wikipedia.org/wiki/Computer_vision Computer vision], [[Mathematician#HSBaird|Henry S. Baird]] and [[Ken Thompson]] used [https://en.wikipedia.org/wiki/Optical_character_recognition optical character recognition] along with various heuristics and applying the rules of chess, to "read" the figurine notation from Informant's [https://en.wikipedia.org/wiki/Encyclopaedia_of_Chess_Openings Encyclopaedia of Chess Openings] with high accuracy and a success rate of 99.995% on approximately one million characters (2850 games, 945 pages) <ref>[[Mathematician#HSBaird|Henry S. Baird]], [[Ken Thompson]] ('''1990'''). ''[http://doc.cat-v.org/bell_labs/reading_chess/ Reading Chess]''. [[IEEE#TPAMI|IEEE Transactions on Pattern Analysis and Machine Intelligence]], Vol. 12, No. 6, [http://doc.cat-v.org/bell_labs/reading_chess/reading_chess.pdf pdf]</ref> .

=See also=
* [[CPW-Engine_algebraic]]
* [[Encoding Moves]]
* [[Entering Moves]]
* [[Portable Game Notation]] (PGN)

=Publications=
* [[Mathematician#HSBaird|Henry S. Baird]], [[Ken Thompson]] ('''1990'''). ''[http://doc.cat-v.org/bell_labs/reading_chess/ Reading Chess]''. [[IEEE#TPAMI|IEEE Transactions on Pattern Analysis and Machine Intelligence]], Vol. 12, No. 6, [http://doc.cat-v.org/bell_labs/reading_chess/reading_chess.pdf pdf]
* [http://goossens.web.cern.ch/goossens/ Michel Goossens], [http://www.informit.com/authors/bio.aspx?a=A2624A62-C2B4-40F9-B8ED-E99563F89A27 Frank Mittelbach], [http://users.ox.ac.uk/%7Erahtz/ Sebastian Rahtz], [http://www.loria.fr/%7Eroegel/ Denis Roegel], [http://www.uit.co.uk/Authors/HerbVoss Herbert Voß] ('''2007'''). ''[http://xml.web.cern.ch/XML/lgc2/ The LATEXGraphics Companion]''. Second Edition, Addison-Wesley, ISBN-13: 978-0-321-50892-8, [http://ptgmedia.pearsoncmg.com/images/9780321508928/samplepages/0321508920_Sample.pdf sample pdf], 10.1 Chess, 10.2 Xiangqi—Chinese Chess <ref>[https://en.wikipedia.org/wiki/LaTeX LaTeX from Wikipedia]</ref>

=Forum Posts=
* [https://www.stmintz.com/ccc/index.php?id=271760 correct SAN notation ?] by [[Andreas Herrmann]], [[CCC]], December 19, 2002
* [https://www.stmintz.com/ccc/index.php?id=337347 Crafty (under winboard) question] by [[Andrei Fortuna]], [[CCC]], December 21, 2003 » [[WinBoard]]
* [http://www.talkchess.com/forum/viewtopic.php?t=33764 SAN Move Disambiguation -- looking for test positition] by humble programmer, [[CCC]], April 12, 2010 » [[Portable Game Notation|PGN]]
* [http://www.talkchess.com/forum/viewtopic.php?t=38318 Unicode values for chessmen] by [[Steven Edwards]], [[CCC]], March 07, 2011
* [http://www.talkchess.com/forum/viewtopic.php?t=41322 Determining From squares] by David Whitten, [[CCC]], December 04, 2011
* [http://www.talkchess.com/forum/viewtopic.php?t=53686 What world have I been in - castling notation?] by Lonnie Cook, [[CCC]], September 13, 2014
* [http://www.talkchess.com/forum/viewtopic.php?t=61393 SAN test position] by [[Matthew Lai]], [[CCC]], September 11, 2016 » [[Algebraic Chess Notation#SAN|SAN]]
* [http://www.talkchess.com/forum/viewtopic.php?t=65193 WAC using coordinate notation?] by [[Erin Dame]], [[CCC]], September 17, 2017 » [[Algebraic Chess Notation#PureCoordinateNotation|Pure coordinate notation]], [[Win at Chess]]

=External Links=
* [https://en.wikipedia.org/wiki/Algebraic_chess_notation Algebraic chess notation from Wikipedia]
* [https://en.wikipedia.org/wiki/Descriptive_chess_notation Desciptive notation from Wikipedia]
* [https://en.wikipedia.org/wiki/Punctuation_%28chess%29 Punctuation (chess) from Wikipedia]
* [https://en.wikipedia.org/wiki/Chess_symbols_in_Unicode Chess symbols in Unicode from Wikipedia]
* [http://www.thechessdrum.net/PGN_Reference.txt Standard: Portable Game Notation Specification and Implementation Guide] by [[Steven Edwards]] - 8.2.3: Movetext SAN (Standard Algebraic Notation)
* [http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/areas/games/chess/san/ SAN Kit: Implemented Standards for Chess Move Notation] by [[Steven Edwards]]
* [http://www.fide.com/component/handbook/?id=171&view=article FIDE handbook, Laws of Chess - Appendix C. Algebraic notation]

=References=
<references />

'''[[Chess Game|Up one Level]]'''

Navigation menu