node-tlcv
node-tlcv copied to clipboard
Engines that send Chess960 castling
In particular, the engine Cheers sends castling via uci Chess960 style (e1h1/e1a1), https://github.com/Algorhythm-sxv/Cheers/issues/2, It appears that the viewer does not handle this meaning the view of the board gets out of sync with the actual game.
Why this would make sense: chess.js doesn't handle chess960. It parses moves by checking against a list of legal moves, and seeing if the string sent matches one. Since chess960 castling would not be a legal move, it would fail.
Why this wouldn't make sense: TLCV sends moves to the viewer in SAN format. Since TLCV/ChessGUI seems to understand and handle e1h1 as castling just fine, then wouldn't it send it to the viewer as "O-O"?
~~It may be worth adding a log statement before move parsing so can check what the viewer is actually receiving in these cases.~~ Edit: nvm, there's a log message, Failed to parse, that should log this.
I also don't know if there's something the viewer could do better in the more general case of receiving a move it doesn't understand.