← Back to context

Comment by nomilk

3 days ago

There's a bug in the Delta Air Lines chess program. After cxd6 en passant, the captured pawn isn't removed [0]. White's bishop is then able to check the black king through the pawn (the pawn that should have been removed) [1].

[0] https://drive.google.com/file/d/1Nyov4F7eWbT8uNoeclPY8uXVG6f...

[1] https://drive.google.com/file/d/1eEPBHqE5rpefE9gWflgS_hUwYGS...

I guess it's just a display bug, then? Though it's hard to imagine what kind of bug would lead the game state and the visual representation to get out of sync in that particular way.

  • They're probably using an OSS chess engine in something like C++, but using HTML/CSS/JS for the interface. 90% moves could be represented by a chess board as a 2D array, checking the engine accepts it as a valid move, and then replacing what's on that square be it empty space or a now captured piece. Castling, pawn promotion, and en passant are the edge cases with en passant being the most obscure.

  • My guess is they only remove captured pieces on the moved-to square (maybe relying on an implicit capture by overwriting an array entry). This is probably easier than actually tracking pieces that get captured.

  • The game is likely in javascript but because of this bug we know it's not using React because with React the programmer doesn't update the view, React does.