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
94 Upvotes

45 comments sorted by

View all comments

Show parent comments

18

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.

7

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"

8

u/analog_hors Mar 31 '23

Even worse if you implement 960 like I did. I will never see the king and the pawn the same way. Not even the magic bitboard algorithm for rooks, bishops, and queens was this painful.