Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PGN changes when loading then running game.toPgn #109

Open
ghost opened this issue May 10, 2023 · 0 comments
Open

PGN changes when loading then running game.toPgn #109

ghost opened this issue May 10, 2023 · 0 comments

Comments

@ghost
Copy link

ghost commented May 10, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants