Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: