How to Program a Chess Engine in Lisp

submited by
Style Pass
2024-12-23 19:00:12

Programming a competent chess engine in lisp has been a goal of mine for some time. I finally did so in 2021, and it was a lot of fun! My new goal is to rewrite the code in a step by step way that emphasizes clarity, and to present it as a clear tutorial for writing a chess engine, and as a general Racket tutorial.

This post is the beginning of that journey, and will be updated as a table of contents for the entire series as each post is written. I’ll also be updating this header post with links to resources as we go along. I’m hoping to complete the series by the end of this month (November 2024).

The primary goal of this project is to provide a clear, understandable tutorial on how to write a chess engine in the Racket programming language. A secondary goal is to find a sweet spot in the tension between clarity and competitiveness, so that the engine can play at a reasonable intermediate level while still being very understandable. My current rating on lichess.org is roughly 1,700 for blitz chess, so the engine should easily beat me if successful. If you’re a more talented chess player, you may need to add additional functionality for the engine to beat you :)

Once the initial tutorial is completed, there will be opportunity for additional functionality. I’d like to leave the original repository in place for pedagogy purposes, but we can refine and optimize a fork to be more competitive if that is of interest to folks.

Leave a Comment