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

Display trait for Game, as PGN string #71

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

yzoug
Copy link

@yzoug yzoug commented Jan 15, 2022

#69

@yzoug yzoug marked this pull request as ready for review April 3, 2022 20:45
@yzoug
Copy link
Author

yzoug commented Apr 3, 2022

This PR is now ready for review. A small detail remains, only for the test I added: promotions are not considered valid SAN moves, hence the test does not include moves like "a8=Q". But those moves are handled correctly, and everything is functional as far as I can tell. Poke @jordanbray! :)

The file is returned in lowercase, because this is used for the PGN
string
The game can be transcribed as a PGN string. Ambiguous moves, promotions
and checks are all handled.
@yzoug yzoug changed the base branch from master to main February 17, 2024 17:30
This was referenced Feb 17, 2024
Comment on lines +42 to +43
pgn: String,
move_number: usize,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both start_pos and all moves are in Game, so it doesn't look like it also always needs to store the PGN: if people use this Game struct for anything else, this is extra useless cost.
These should probably just be local variables of the Display implementation.

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

Successfully merging this pull request may close these issues.

2 participants