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

enter game notation - feature request & parse error #1415

Closed
BriCra17gh opened this issue May 6, 2017 · 3 comments
Closed

enter game notation - feature request & parse error #1415

BriCra17gh opened this issue May 6, 2017 · 3 comments

Comments

@BriCra17gh
Copy link

BriCra17gh commented May 6, 2017

Would it be possible to relax the rules of PGN when entering a game? For example, allow "oo" or "00" for castling. Currently such notation is silently ignored or results in a non-intuitive error message, depending on the case.

Another example is allow lower case letters for minor/major pieces ("nxe4" for "Nxe4"). Currently the parser produces unexpected output from such input.

Here are examples (see bold for unexpected output):

In: 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. oo nxe4
Out: error popup displays "Invalid move. 4.e2e4"

In: 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. o-o nxe4
Out: 1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O exe4

In: 1. e4 e5 2. nf3
Out: 1. e4 e5 2. f3

BriCra

@gbtami
Copy link
Member

gbtami commented May 7, 2017

You can find the pgn parser regexp in https://github.com/pychess/pychess/blob/master/lib/pychess/Savers/pgn.py
I think it's rather forgiving but if you can make it more relaxed go for it. Patches are welcome!

@BriCra17gh
Copy link
Author

BriCra17gh commented May 7, 2017

I would need to learn python in order to help. I might do that.

I'd like to try to make sure I expressed things clearly in my post. Aside from the feature request of non-standard notation, I was pointing out a few problems:

  • an error message that does not reflect the error (ex. 1)
  • changing non-standard input to an illegal move (ex. 2)
  • changing non-standard input to a legal, but unintended move (ex. 3)

It seems to me that if non-standard input is disallowed, then the user should be informed of the erroneous input and that incorrect output should not be generated. What do you think?

@gbtami
Copy link
Member

gbtami commented May 7, 2017

Agreed.

@gbtami gbtami changed the title enter game notation - feature request & parse error - reference pychess_0.12.4-1_all.deb enter game notation - feature request & parse error Sep 26, 2017
@gbtami gbtami closed this as completed in eeb4d04 Oct 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants