Skip to content

The Match File ​

scotch match game --json writes the match as one JSON object holding the submitted game, the stored game, and the run the two share, which the Viewer opens, and - in place of a path prints the object alone. Each table below is written by mise run docs:render from the record declaring it in src/scotch/index/schemas.py.

submitted holds your game, and stored the grandmaster game sharing its longest run.

"submitted": {An object, as Side holds itThe submitted game.
"headers": {"Event": "The Tournament of Falsehoods","Site": "?","Date": "2022.08.21",… 5 more},An object of stringsThe value of each tag pair keyed by its name.
"moves": ["d4", "Nf6", "c4", "e6", … 103 more],An array of stringsThe moves of the mainline in Standard Algebraic Notation (SAN).
"placements": ["rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR", … 107 more]An array of stringsThe piece placement of each position from the start, one more than the moves.
}
"span": {An object, as Span holds it, or nullThe run of positions the two games share, left empty where no stored game shares a position with the submitted game.
"length": 43,An integer from 1The number of positions the run holds.
"offset": 0,An integerThe stored game's ply minus the submitted game's ply, the same at every position of the run.
"start": 0An integer from 0The submitted game's ply at the first position of the run.
}
"stored": {An object, as Side holds it, or nullThe stored game, left empty where no stored game shares a position with the submitted game.
"headers": {"Event": "Tilburg","Site": "Tilburg","Date": "1981.??.??",… 7 more},An object of stringsThe value of each tag pair keyed by its name.
"moves": ["d4", "Nf6", "c4", "e6", … 53 more],An array of stringsThe moves of the mainline in Standard Algebraic Notation (SAN).
"placements": ["rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR", … 57 more]An array of stringsThe piece placement of each position from the start, one more than the moves.
}
"ties": 0An integer from 0The count of other stored games sharing a run as long as the stored game's, 0 where none does or where no stored game shares a position.
The table beneath
FieldTypeMeaning
submittedAn object, as Side holds itThe submitted game.
spanAn object, as Span holds it, or nullThe run of positions the two games share, left empty where no stored game shares a position with the submitted game.
storedAn object, as Side holds it, or nullThe stored game, left empty where no stored game shares a position with the submitted game.
tiesAn integer from 0The count of other stored games sharing a run as long as the stored game's, 0 where none does or where no stored game shares a position.

Each Game ​

submitted and stored each hold one game in the fields Side declares:

FieldTypeMeaning
headersAn object of stringsThe value of each tag pair keyed by its name.
movesAn array of stringsThe moves of the mainline in Standard Algebraic Notation (SAN).
placementsAn array of stringsThe piece placement of each position from the start, one more than the moves.

The Run ​

span holds the run the two games share in the fields Span declares, its first position at ply start of the submitted game and ply start plus offset of the stored game:

FieldTypeMeaning
lengthAn integer from 1The number of positions the run holds.
offsetAn integerThe stored game's ply minus the submitted game's ply, the same at every position of the run.
startAn integer from 0The submitted game's ply at the first position of the run.

The Demo's File ​

demo.json is the file scotch match game docs/public/games/demo.pgn --json writes, which mise run docs:render writes from the index. Where no stored game shares a position with the submitted game, span and stored are null and ties is 0, as alone.json holds for the demo game matched against no stored game.

The Address ​

scotch match game --link prints the address of the Viewer holding the same object in its fragment after #match=, deflated into a ZLIB stream and encoded in unpadded base64url, so the Viewer opens the match without a file, and the browser sends none of it to a server. The demo's address runs to 1,764 characters.

Built from22ebd11
CodeJybbs/scotch
GamesPGN Mentor
Crateshakmaty, GPL
FacesSIL OFL 1.1
PiecesCburnett, BSD

Scotch 0.2.0, under the GPL-3.0-or-later.