-
Notifications
You must be signed in to change notification settings - Fork 13
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
Contains atypical PGN parser, difficult to debug #14
Comments
Hi, firstly thanks for the detailed issue description. I had a look at the game and in 42nd move, as you mentioned, while queens on both g8 and h1 can move to h7, due to the fact that queen on the g8 is pinned by white queen in c8, |
Thank you for looking into the issue! Sadly, I won't be of much help anymore: I have read none of the repo's code and I'm helpless at OOP anyway, and as you may have guessed from the game, my (White's) strategic intelligence is at the level of a 9-year-old who just learnt how promotion works and what the word "harem" means. (Still better than Black though, who is just a dumb copycat.) So I didn't even realize that the queen was pinned - I only know chess rules, no strategy. Due to lacking programming experience and English being my second language, I may have misused the word "parser" in place of "interpreter" or another more suitable denomination (perhaps the appropriate function has a name in the code but I haven't read it, sorry). By the way, this project is awesome for its purpose, and though the quality could have been better than 480p, I won't complain. For this reason, I looked no further than here for the export of my games, though the option for the duration of individual frames seems like a missing basic feature (fortunately, GIF editors make up for it). What I find best about this SW is its good use of the redefinable 256-color palette (unlike Chess.com's GIF creator, which even dithers colors of the board!) (Well, this should not be a surprise when you compare someone's love project on Github to a corporation's proprietary code they wanted to get done ASAP.) Cheers! |
The following PGN was exported from Lichess.org (line breaks added by me to highlight moves 42 and 54):
When run with this input file, your code outputs no GIF and the exception handler gives the following, rather cryptic message:
By shortening the file using trial-and error, I determined that the crash happens at Black's move 54. If
Qgf8
and all following text is removed, a GIF is generated. However, unlike the output of all online PGN players and converters I tried, it does not end with a black queen in columng
(there should have been one atG8
). Turns out, your program moved theG8
queen in move 42, "42. .. Qh7
". Either queen (G8
orH1
) could move there, and it was not specified. This ambiguity is likely a mistake on Lichess' part, and I am not blaming you for handling it wrong. However, it is annoying that your PGN parser behaved differently from all others tested. The game can be fixed by rewriting Move 42 to42. Qa2 Qhh7
to remove the ambiguity.For reference, here is the chessboard state after White's move 42 (just before the parsing "mistake") and White's move 54 (just before the crash), respectively:
Also, FEN of the above positions for import into a viewer:
So, how could you improve the user experence? In either of two ways:
1. e4 Nf6
becomes1. e2e4 Ng8f6
(if such software exists).Such error reporting could look like this:
Note that in Move 42, White's ambiguous move was resolved as expected while Black's wasn't.
The text was updated successfully, but these errors were encountered: