thomas-mauran / chess-tui

A chess TUI implementation in rust 🦀
https://crates.io/crates/chess-tui
MIT License
355 stars 20 forks source link

feat: pgn export #23

Open thomas-mauran opened 9 months ago

thomas-mauran commented 9 months ago

Implement a pgn export method

Solution

xiangsgao commented 4 months ago

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 commented 4 months ago

@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 commented 3 months ago

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

https://github.com/thomas-mauran/chess-tui/assets/22754842/0db9693c-e588-491a-95f9-b739c941d1ca

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 commented 3 months ago

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

xiangsgao commented 3 months ago

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 commented 3 months ago

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 commented 2 months ago

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 commented 2 months ago

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.