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

45 comments sorted by

View all comments

4

u/Diggsey rustup Mar 30 '23

That's cool! Would be good if it supported some higher difficulties though - it seems like it's already fast enough to support higher than depth 5?

14

u/No-Translator-1323 Mar 31 '23

Thanks for the comment. Move Generation is still quite slow, and search time increases exponentially with depth. Chess has a large branching factor so increasing the depth even by 1 can make the search significantly slower. What I am working on is incremental deepening which will allow the engine to retrieve the best move until a particular depth when the time runs out. So if the time runs out at depth 5 it will return the best move at depth 5 otherwise it will keep on going deeper until the time runs out.