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

feat: pgn export #23

Open
thomas-mauran opened this issue Dec 3, 2023 · 8 comments
Open

feat: pgn export #23

thomas-mauran opened this issue Dec 3, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@thomas-mauran
Copy link
Owner

Implement a pgn export method

Solution

  • Create a new method to convert move_history into pgn
  • store it into a file
@thomas-mauran thomas-mauran added the enhancement New feature or request label Dec 3, 2023
@xiangsgao
Copy link

Hey, i love your project. I have always wanted to create my own chess game for a while but have never gotten around to actually doing it. Perhaps I can help out with this feature? It will partially satisfy something I have wished to do for a long time.

@thomas-mauran
Copy link
Owner Author

@xiangsgao great to hear you like the project, I would love to get your help on this feature for sure since it's not what I will be working on soon, I'm aiming for the black board turn and the ssh implementation in the following weeks !

@xiangsgao
Copy link

hey, quick question. what editor/ide are you using and what is your debugger? I am currently using intellij with rust plugin on Windows and I found the internal terminal that opens up when debugging to be completely unusable.

it looks like this

Recording.2024-05-27.192346.mp4

so yeah....
i don't think it is an issue with the game itself, it works fine on regular Windows cmd but if I use some third-party terminal emulator like git bash or the one in intellij as shown above, it breaks and is none functional.

@thomas-mauran
Copy link
Owner Author

Hello @xiangsgao I use vs code and I run the game in a regular ubuntu terminal

@xiangsgao
Copy link

xiangsgao commented Jun 14, 2024

hey @thomas-mauran

I apologize for the long inactivity. I had a recent life-changing event, I have been just busy trying to glue my life back together. Rest assured, I have not abandoned this. I will get to it eventually. In the meantime, I do have some questions. Where in the gameboard do you check for piece capture, castling move, pawn promotion, checking move, and checkmating move? I can figure it out if I set enough breakpoints and spend more time code reading, but it would save much time if you could point me to the right line number or just the right file.

Thanks

@thomas-mauran
Copy link
Owner Author

Hello @xiangsgao, I am very sorry to hear that ! There is no problem at all I hope the best for you and wish you to find another even better job. I am a bit inactive right now due to other events at my school, sorry for the delay, I will provide you all the information soon with the files and line number !

@nicholasmello
Copy link
Contributor

hey @thomas-mauran

I apologize for the long inactivity. I had a recent life-changing event, recently lost my job and I have been just busy trying to glue my life back together. Rest assured, I have not abandoned this. I will get to it eventually. In the meantime, I do have some questions. Where in the gameboard do you check for piece capture, castling move, pawn promotion, checking move, and checkmating move? I can figure it out if I set enough breakpoints and spend more time code reading, but it would save much time if you could point me to the right line number or just the right file.

Thanks

I just expanded the history system in PR #76 to include is_en_passant and promotion_piece (which will be None if it is not a promotion). Check and checkmate are not stored in the history system, checks you could add to the struct and checkmate you could run the is_checkmate method since that only applies to the current position (i.e. there are no moves after checkmate).

I am checking for castling each time I go backward but we could add that as another struct field as well if that is helpful.

https://github.com/thomas-mauran/chess-tui/pull/76/files#diff-4f6d6f0a0be5913656c1add1fc5a4c903bed453b7ae9005a996e2cd3ffaf411eR1067-R1069

@xiangsgao
Copy link

hey @thomas-mauran
I apologize for the long inactivity. I had a recent life-changing event, recently lost my job and I have been just busy trying to glue my life back together. Rest assured, I have not abandoned this. I will get to it eventually. In the meantime, I do have some questions. Where in the gameboard do you check for piece capture, castling move, pawn promotion, checking move, and checkmating move? I can figure it out if I set enough breakpoints and spend more time code reading, but it would save much time if you could point me to the right line number or just the right file.
Thanks

I just expanded the history system in PR #76 to include is_en_passant and promotion_piece (which will be None if it is not a promotion). Check and checkmate are not stored in the history system, checks you could add to the struct and checkmate you could run the is_checkmate method since that only applies to the current position (i.e. there are no moves after checkmate).

I am checking for castling each time I go backward but we could add that as another struct field as well if that is helpful.

https://github.com/thomas-mauran/chess-tui/pull/76/files#diff-4f6d6f0a0be5913656c1add1fc5a4c903bed453b7ae9005a996e2cd3ffaf411eR1067-R1069

awesome, thank you. this will be helpful indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

3 participants