Geras1mleo / Chess

C# .NET 6.0 Chess Library
MIT License
49 stars 15 forks source link

Chess bug #14

Closed ratan3577 closed 8 months ago

ratan3577 commented 1 year ago

Describe the bug Castling move is not shown properly in ExecutedMoves. It is applicable in both short castling and long castling. Instead of e8g8, it is showing e8h8 for black short castling. Same way instead of White long castling it is showing e1a1 instead of e1c1.
Conversions / Validations / ...

To Reproduce Steps to reproduce the behaviour or Eventually a call stack and input data

        string str = "1. e4 c5 2. Nf3 d6 3. Nc3 Nc6 4. Bb5 Nf6 5. d3 a6 6. Bxc6+ bxc6 7. Bg5 g6 8. Qd2 Bg7 9. Bh6 O-O 10. Bxg7 Kxg7 11. O-O-O Rb8 12. Ng5 Qb6 13. Na4 Qb5 14. b3 d5 15. e5 Nd7 16. e6 Nf6 17. exf7 h6 18. Nf3 Be6 19. Ne5 Bxf7 20. Nxf7 Rxf7 21. f3 c4 22. dxc4 dxc4 23. Qc3 cxb3 24. axb3 Qg5+ 25. Kb1 e6 26. Nc5 Kg8 27. g4 Rb5 28. Rd8+ Rf8 29. Rxf8+ Kxf8 30. Nxe6+ Kf7 31. Nxg5+ 1-0";

var board = new ChessBoard(); board = ChessBoard.LoadFromPgn(str); foreach(var move in board.ExecutedMoves) {

//Check 9th move of black and 11th move of white. Instead of e8g8, it is showing e8h8 for black short castling. Same way instead of White long castling it is showing e1a1 instead of e1c1. King would not move to extreme corner after castling.

}

Expected behaviour A clear and concise description of what you expected to happen.

Black short castling = e8g8 White long castle = e1c1

same way, Black long castling = e8c8 White short castle = e1g1

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

Geras1mleo commented 1 year ago

I will make it optional behavior. Thank you for your feedback

zakkoo commented 1 year ago

Hi Geras

That sounds great. Thank you for your wonderful project. I'm building an app based on it and I love it. Keep up the good work.

Best regards, Chess fan

Am 18.04.2023 um 17:36 schrieb Sviatoslav @.***>:

I will make it optional behavior. Thank you for your feedback

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>