Compact Game Notation (followingly, "CGN") is an alternative to Portable Game Notation, made to fit chess games in as few bytes as possible.
Tags have been borrowed from PGN with a couple of exceptions:
/). Furthermore, the halfmove clock and move count only need to be given if the game doesn't start at move 1.
The first bit of a move determines if this is a control move (1) or a played move (0).
If a played move was given, there are 15 more bits to it (totaling 2 bytes):
000): This move is not a promotion.
001): Promoting to a knight.
010): Promoting to a bishop.
011): Promoting to a rook.
100): Promoting to a queen.
101): Promoting to a king.
However, if a control move was given, this is not an actual move but rather an indicator with a total length of 1 byte and the remaining 7 bits will declare its meaning:
0000000): There are no more moves. If the last move did not result in checkmate or stalemate and a Result of
1/2-1/2is given, a resignation or draw agreement should be assumed.
0000001): A null-terminated string containg an annotation (usually for the previous move) will follow.
Compact Game Notation (CGN) Specification — Copyright (c) 2018, Tim Speckhals
Version: 2018-07-23 — Last Modified: 2018-08-01 (Fixed Typo)
Markdown parsed using Parsedown — Raw markdown version here
Style by Caret