frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

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

https://constrainedchess.vercel.app/
2•vigrant•2h ago
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%...

Comments

vunderba•1h ago
> 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.

Hmmm... I can immediately think of a reason this won't work.

If I create a constraint that says "Bishops are only capable of moving 4 squares maximum", the set of valid moves you are passing into Stockfish only affects the initial move.

But as soon as it starts to build the minimax-equivalent search tree, it's no longer enforcing that constraint.

To make this work, you’d have to get Stockfish to continuously enforce the “bishop move” rule at every ply during its search.

Caveat - unless this is something you are enforcing in searchmoves? I don't have a lot of experience with in-depth usage of Stockfish.

Alternatively, you could look into Fairy-Stockfish, which allows you to define rule variants.

https://fairy-stockfish.github.io

vigrant•1h ago
The constraint is enforced at every move. Stockfish can never actually play against it. The only limitation is that its internal search tree imagines unconstrained future moves, which makes its evaluation slightly off and the engine effectively weaker. For the use case (handicapping for fun) that's an acceptable tradeoff

https://constrainedchess.vercel.app/?fen=2b1kb2%2F8%2F8%2F8%...

vunderba•52m ago
> The only limitation is that its internal search tree imagines unconstrained future moves.

Yes this is what I'm saying. Evaluation can be way more than just "slightly off" though and can make the evaluation MUCH weaker because it might go down "ply-routes" that aren't just suboptimal - they simply wouldn't work at all.

For example thinking it had a "move set" that lead to a checkmate but the final ply involves a bishop that is five squares away per my rule constraint mentioned earlier.

It's fine for fun but the statement that "Stockfish's skill level applies correctly" is not a true one at any moderate level of play. (above 1200 ELO).

That's why I suggested looking into Fairy which supports runtime rule variations.

Man's Search for Meaning (1963)

https://archive.org/details/isbn_067182161x
1•turtleyacht•41s ago•0 comments

Moved to SF alone. No network, no YC. One year in

https://twitter.com/eacheftal/status/2027901456029036931
1•eftalyurtseven•2m ago•1 comments

Computers Should Be Liberating

https://jyn.dev/liberating
1•kristianpaul•4m ago•0 comments

Trump just got much closer to bringing CNN to heel

https://www.theguardian.com/commentisfree/2026/feb/28/trump-paramount-skydance-warner-bros-cnn-ne...
2•KnuthIsGod•6m ago•0 comments

P5.lcd – P5.js on an LCD Shader

https://p5.lcd.tulv.in/
1•atulvi•7m ago•0 comments

Raspberry Pi Pico as AM Radio Transmitter

https://www.pesfandiar.com/blog/2026/02/28/pico-am-radio-transmitter
2•pesfandiar•7m ago•0 comments

Carbon dioxide overload in human blood suggests a toxic atmosphere in 50 years

https://link.springer.com/article/10.1007/s11869-026-01918-5
2•OutOfHere•10m ago•1 comments

Zillow for Warcraft

https://zillowforwarcraft.com/
2•rmast•11m ago•0 comments

A Collection of Old Trump Tweets on Iran

https://old.reddit.com/r/centrist/comments/1lhpepz/a_collection_of_old_trump_tweets_on_iran/
2•jamesgill•11m ago•0 comments

Bacterial biofilms are intrinsic components of calcium-based kidney stones

https://www.pnas.org/doi/10.1073/pnas.2517066123
2•dreamingincode•13m ago•0 comments

Tricking CC to write better code

https://old.reddit.com/r/ClaudeAI/comments/1qlpcwg/easiest_way_i_have_found_claude_to_write_high/
2•vincirufus•13m ago•0 comments

The rise–and fall–of the software developer (2024)

https://www.adpresearch.com/the-rise-and-fall-of-the-software-developer/
2•tangjurine•14m ago•0 comments

Reverse-engineering how Claude's Chrome extension controls the browser

https://gist.github.com/sshh12/e352c053627ccbe1636781f73d6d715b
2•sshh12•18m ago•1 comments

MedKit – A Unified Python SDK for OpenFDA, PubMed, and ClinicalTrials.gov

https://github.com/interestng/medkit
2•interestng•18m ago•1 comments

Show HN: Usplus.ai – Build an AI-Native Company with Agents in your Org Chart

https://usplus.ai/
2•usplusAI•19m ago•0 comments

Show HN: Web Scout AI – Auto-discover every user journey (zero config)

https://github.com/apexkid/web-scout-ai
2•apexkid•21m ago•1 comments

"That Shape Had None" – A Tragedy of Substrate Independence (Short Fiction)

https://starlightconvenience.net/#that-shape-had-none
2•casmalia•22m ago•0 comments

War Is a Racket (Maj. Gen. Smedley Butler, USMC)

https://archive.org/details/WarIsARacket
4•jamesgill•24m ago•0 comments

Ask HN: How comfortable are we with agents everywhere?

3•teekert•25m ago•1 comments

Claude surpasses ChatGPT to become the #1 app on the US App Store

https://apps.apple.com/us/iphone/charts
155•byincugnito•25m ago•40 comments

People of Iran Celebrating

https://old.reddit.com/r/NewIran/
5•consumer451•28m ago•0 comments

Show HN: KiboUP – Deploy AI Agents via HTTP, A2A, and MCP with One Codebase

https://github.com/tu-usuario/kiboserve
2•D10S0VSkY-OSS•30m ago•0 comments

Novelist interview-Chuck Palahniuk [video] (2024)

https://www.youtube.com/watch?v=czBL7JQl248
2•nz•31m ago•0 comments

New online database maps Prague's art monuments and architecture

https://english.radio.cz/new-online-database-maps-pragues-art-monuments-and-architecture-8878703
2•gnabgib•36m ago•0 comments

Open source package repositories face sustainability crisis

https://www.theregister.com/2026/02/28/open_source_opinion/
2•Anthony-G•37m ago•0 comments

Most Code Deserves to Die

https://chatbotkit.com/reflections/most-code-deserves-to-die
2•_pdp_•37m ago•1 comments

Show HN: Explain Curl Commands

https://github.com/akgitrepos/explain-my-curl
2•akgitrepos•38m ago•0 comments

Show HN: Salacia – The First Runtime OS for Agentic Coding

https://startripai.github.io/Salacia/
2•alfredhua•43m ago•0 comments

Pentagon chief blocks officers from Ivy League schools and top universities

https://fortune.com/2026/02/28/pentagon-officer-education-ivy-league-schools-universities-partner...
25•geox•43m ago•3 comments

As SuperAgers age, they make at least twice as many new neurons as their peers

https://news.northwestern.edu/stories/2026/02/as-superagers-age-they-make-at-least-twice-as-many-...
3•hhs•46m ago•0 comments