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

Export FEN position for a given move #2

Open
mdallastella opened this issue Jan 7, 2018 · 3 comments
Open

Export FEN position for a given move #2

mdallastella opened this issue Jan 7, 2018 · 3 comments
Assignees
Milestone

Comments

@mdallastella
Copy link
Owner

Return the FEN notation for a given half-move coordinate.

Given a PGN with 1. e4 e5 2. Nf3 Nc6

Example (pseudo code):

user> (fen-position :white 2 parsed-pgn)
"rnbqkbnr/pppp1ppp/8/4p3/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq -"

See https://en.wikipedia.org/wiki/Forsyth–Edwards_Notation

@mdallastella mdallastella added this to the 0.1.1 milestone Jan 7, 2018
@mdallastella mdallastella self-assigned this Jan 7, 2018
@erjoalgo
Copy link

Hello. This feature would be very useful, has it been implemented?

@mdallastella
Copy link
Owner Author

Hello @erjoalgo, unfortunately no, this feature hasn't been implemented.

To make it work, a chessboard representation should be kept in memory, so the library can simulate all the moves and return a FEN string.

We should also keep in mind that a FEN string also report castling availability and en passant target square, so the library also needs to calculate possible moves… Not as simple as it sounds…

Let me know if you're interested in this ticket.

@erjoalgo
Copy link

erjoalgo commented Nov 2, 2024

https://github.com/wolfraam/chess-game I'm integrating this library, which does the heavy lifting in terms of keeping track of game state and listing legal moves. Perhaps the best option to provide this feature would be to use chess-game internally, and this would avoid duplicating effort.

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