kokopu
Version:
A JavaScript/TypeScript library implementing the chess game rules and providing tools to read/write the standard chess file formats.
44 lines (43 loc) • 1.81 kB
Plain Text
Event = {Game with long/short comment descriptors}
[] -+<LONG {Empty line after first comment of variation => LONG.}<LONG
[] (1w) e4 (
[] (1b) e5 (
|
[] +---+ {Within short variation, always SHORT.}
[] | (1b) e6 (
|
[] (2w) Nf3 (
[] (2b) Nc6 (
[] (3w) Bb5 (
|
[] +---+<LONG {No empty line after => SHORT.}
[] | (3w) Bc4 (
[] | (3b) Bc5 (
|
[] (3b) a6 (
[] (4w) Bxc6 (
|
[] +---+<LONG {Empty line after first comment of variation => LONG.}<LONG
[] | (4w) Ba4 (
[] | (4b) b5 (
|
[] (4b) dxc6 (
+---+---+---+---+---+---+---+---+
| r | | b | q | k | b | n | r |
+---+---+---+---+---+---+---+---+
| | p | p | | | p | p | p |
+---+---+---+---+---+---+---+---+
| p | | p | | | | | |
+---+---+---+---+---+---+---+---+
| | | | | p | | | |
+---+---+---+---+---+---+---+---+
| | | | | P | | | |
+---+---+---+---+---+---+---+---+
| | | | | | N | | |
+---+---+---+---+---+---+---+---+
| P | P | P | P | | P | P | P |
+---+---+---+---+---+---+---+---+
| R | N | B | Q | K | | | R |
+---+---+---+---+---+---+---+---+
w KQkq -
{Draw}{8 plies}