2025· Engineer
Chess, from scratch
I wrote chess with all its rules, no chess library involved. First in Java, then ported to JavaScript so it runs in the browser. You can actually play it on this site.
Board model, per-piece move generation, check and mate detection, pawn promotion. No chess library; every rule is written by hand.
The part that fought back the most was the "you can't leave your king in check" filter: for every candidate move I copy the board, play the move, and look at whether the king is safe.
The Java core lives on desktop; the JS build runs on this site with no backend at all. I still poke at it. Castling and en passant are next on the list.
- Playable on this site
- No libraries, rules written by hand
- Check, mate and promotion work; castling is next
- Java core + a JS port
JavaJavaScriptOOPGame Logic