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

Promotion notation should support input syntax without the equal sign #1

Open
Rqnsom opened this issue Jun 9, 2022 · 0 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Rqnsom
Copy link
Owner

Rqnsom commented Jun 9, 2022

Currently the promotion notation is printed out in this format below:

  • a8=Q
  • axb1=Q

And that printout format is fine for now.
To generate Turn structs we use:

let a8_promotion = Turn::try_form("a8=Q");
let b1_promotion = Turn::try_form("axb1=Q");

What is not supported today, but should be supported in Turn::try_form function is the same promotion but also with this syntax:

let a8_promotion = Turn::try_form("a8Q");  // No equal sign
let b1_promotion = Turn::try_form("axb1Q");  // No equal sign

assert_eq!(Turn::try_form("a8Q"), Turn::try_form("a8=Q"));
assert!(Turn::try_form("axb1Q").is_ok());

Quote from chess.com

The official FIDE way to indicate a pawn promotion is the notation for the pawn move with the addition of the piece the pawn was promoted to at the end. If a pawn on the a-file promotes to a queen, the official FIDE notation would be a8Q. If a pawn on the f-file captures another piece on the e-file and promotes to a knight, fxe8N.

@Rqnsom Rqnsom added enhancement New feature or request good first issue Good for newcomers labels Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant