Closed juhoha closed 2 years ago
Seems that some computer protocols use this notation for castling e8h8
. https://github.com/niklasf/shakmaty/issues/13
I'll try to add support to this notation with some tests also.
Pushed new chess version 0.3.3
that supports UCI castling notation.
@juhoha let me know if this works for you. Thanks.
Cheers! Don't think I've got my project lying around anymore – was bit of a fire and forget let's these games parsed kind of an ordeal :-) Anyway I think this ought to take care of it for anyone that follows and wants to do Lichess parses!
I'm not super familiar with the code base so I originally had a weird sanity check of "check the FEN if castling is allowed" to prevent edge cases where say a rook is in king's starting position and tries to move back to a rook's starting position. Was worried that might be misinterpreted as a castling as the notation (eg. e8h8) is ambiguous (or rather game state -dependant): Assuming a legal move it might be a king castling or a rook/queen actually moving from e8 to h8. Not sure if this ever actually an issue or if there was already something handling it. If not, I think handling that case was dropped when cleaning the code.
Ran into issues with coordinate notation using data from Lichess. The castling's presented as e8h8 instead of e8g8: example Wikipedia and this gem follow the latter. Not sure if this is some wider spread alternative convention or a Lichess oddity.
Any way made a local quickfix to get these games to parse. Here's the patch I used, in case interested: