UNPKG

kokopu

Version:

A JavaScript/TypeScript library implementing the chess game rules and providing tools to read/write the standard chess file formats.

50 lines (49 loc) 1.65 kB
Event = {Game with variation shortened from the beginning.} +---+---+---+---+---+---+---+---+ | r | n | 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 | B | | R | +---+---+---+---+---+---+---+---+ b KQkq - Initial move number = {2} [start] -+<LONG [2b] (2b) Nc6 (#hm=1) [3w] (3w) Bc4 (#hm=2) | [3w-v0-start] +---+ [3w-v0-3w] | (3w) Nc3 (#hm=2) [3w-v0-3b] | (3b) Nf6 (#hm=3) [3w-v0-4w] | (4w) d4 (#hm=0) | [3b] (3b) Bc5 (#hm=3) +---+---+---+---+---+---+---+---+ | r | | b | q | k | | n | r | +---+---+---+---+---+---+---+---+ | p | p | p | p | | p | p | p | +---+---+---+---+---+---+---+---+ | | | n | | | | | | +---+---+---+---+---+---+---+---+ | | | b | | p | | | | +---+---+---+---+---+---+---+---+ | | | B | | P | | | | +---+---+---+---+---+---+---+---+ | | | | | | N | | | +---+---+---+---+---+---+---+---+ | P | P | P | P | | P | P | P | +---+---+---+---+---+---+---+---+ | R | N | B | Q | K | | | R | +---+---+---+---+---+---+---+---+ w KQkq - {Line}{3 plies}