I’ve always enjoyed gaming, and have written my fair share of game bots in the past.
However complicated those bots were, they were never near the difficulty of building a chess engine from scratch. But were they?…
In this series of posts, we are going to tackle that challenge in JavaScript.
The Goal
The goal is simple: to build an engine that can beat its Great Master: me!
Why JavaScript?
Fair question.
Everybody knows that if you are looking for great performance, there are better languages out there.
The primary reason we are going with JavaScript is that we are not looking to build the next Stockfish. I’m not the best of players, and I have a feeling JavaScript may be enough to defeat my sorry a**.
The second reason is learning: as the series progresses we may need to look start looking into secondary threads, processes and some other interesting stuff. It may be instructive to play with those both in NodeJS, as well as in the browser.
The Plan
We are mostly free rolling here, but an initial outline would look something like this:
- Intro (this post)
- Initial setup & Random Playing Bot
- Minimax
- Pruned Minimax
- Developing an improved static evaluation function
- Multi thread/process work
- Machine learning assisted evaluation
- Defeat the Great Devimal. Make him cry.
It’s worth noting that at first we are going to keep things running in the browser. Later in the series we may explore switching things into a NodeJS backend.
If this the sort of thing interests you, stay tuned. The links to all posts in the series will be visible at the very top of each post.
Peace!