Skip to content

PGN changes when loading then running game.toPgn #109

@ghost

Description

This is the attributes part of the original PGN from the chess.com API:

[Event "Live Chess"]
[Site "Chess.com"]
[Date "2021.08.31"]
[Round "-"]
[White "Malzawar"]
[Black "edwinuchiha"]
[Result "1-0"]
[CurrentPosition "4k2Q/4n2p/8/5p2/6p1/4B1P1/P4P1P/4NRK1 b - -"]
[Timezone "UTC"]
[ECO "A10"]
[ECOUrl "https://www.chess.com/openings/English-Opening-1...b6-2.d4-Bb7"]
[UTCDate "2021.08.31"]
[UTCTime "23:22:16"]
[WhiteElo "881"]
[BlackElo "840"]
[TimeControl "600"]
[Termination "Malzawar won by resignation"]
[StartTime "23:22:16"]
[EndDate "2021.08.31"]
[EndTime "23:31:01"]
[Link "https://www.chess.com/game/live/24191220599"]

When loading it into a game and then using game.toPgn(false, true) the resulting PGN differs:

[Event "Live Chess"]
[Site "Chess.com"]
[Date "2021.08.31"]
[Round "1"]
[White "Malzawar"]
[Black "edwinuchiha"]
[Result "1-0"]
[PlyCount "63"]
[Termination "unterminated"]
[TimeControl "600"]
[ECO "A10"]
[WhiteElo "881"]
[BlackElo "840"]
[Timezone "UTC"]
[UTCTime "23:22:16"]
[CurrentPosition "4k2Q/4n2p/8/5p2/6p1/4B1P1/P4P1P/4NRK1 b - -"]
[EndTime "23:31:01"]
[StartTime "23:22:16"]
[UTCDate "2021.08.31"]
[ECOUrl "https://www.chess.com/openings/English-Opening-1...b6-2.d4-Bb7"]
[EndDate "2021.08.31"]
[Link "https://www.chess.com/game/live/24191220599"]

A list of differences (original vs output):

  1. [Round "-"] vs [Round "1"]
  2. [Termination "Malzawar won by resignation"] vs [Termination "unterminated"]

Difference 1. is fine as it is up to interpretation whether round 1 of a total of 1 rounds means that there are no meaningful rounds to count or that there is 1 round.

Difference 2. is just plain wrong. The Result field is (1-0) and game.getResult() returns WHITE_WON, which implies that the game terminated somehow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions