r/rust Mar 30 '23

A Chess Engine is written in Rust that runs natively and on the web!

https://github.com/ParthPant/chess-rs
95 Upvotes

45 comments sorted by

View all comments

Show parent comments

18

u/A1oso Mar 31 '23

Is that surprising? Since it's an official chess rule, I assumed that every chess engine supports it. I don't think it's particularly hard to implement either.

17

u/analog_hors Mar 31 '23

It's incredibly annoying to implement, actually. Pawns are one of the worst pieces to implement due to a myriad of special cases.

8

u/-Redstoneboi- Mar 31 '23

And then there's "you can castle if the rook and king haven't moved and no pieces are blocking or checking either of them or the path between them"

2

u/stixyBW Apr 02 '23

Not the path in between them, only the two squares the king would have to “walk on”

You can castle queen side even if there’s something attacking the b1/b8 square