Show HN: Constrained Chess, Play Stockfish with custom natural-language rules

  • Posted 3 hours ago by vigrant
  • 2 points
https://constrainedchess.vercel.app/
Built this mostly with AI assistance (vibe-coded). Stockfish 16 runs in the browser via WASM. Constraints are parsed in two layers: a hand-written rule parser handles common patterns (no captures, piece restrictions, no castling, etc.), and anything it can't match falls through to Claude Haiku, which generates a JavaScript matches(uciMove, chess) function on the fly. That function runs client-side and filters the list of legal UCI moves before being passed to Stockfish's searchmoves parameter, so Stockfish's skill level, depth, and randomness all still apply correctly within the allowed set.

Constraints can target the engine, the player, or both. Shareable via URL (FEN + constraints + ELO encoded as query params).

Pre-loaded challenge if you want to skip setup:

https://constrainedchess.vercel.app/?skill=5&c=player%7Ccan%...

1 comments

    Loading..