Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Preface

Hi there. Nice of you to hang around. I’m Marcel, the author of the chess engine Rustic and the writer of this text. You’re about to step into the wonderful and occasionally frustrating world of chess programming. This can be a rewarding endeavour, but addictive may be the better word. There will be challenges, but perseverance will help you overcome them one at a time. When you reach the point where your chess engine is capable of playing its first full game against yourself or another engine, you will have created something to be proud of.

This book teaches chess programming by using the chess engine Rustic as an example. It is written in rust. Rather than presenting isolated snippets or toy examples, the goal is to explore how a complete engine is structured and evolves over time.

Chess programming has a long and rich history. If you write your own engine from scratch, you will become part of a tradition that started at the dawn of the computer age in the early 1950s. Many chess programmers have come before, and many more will follow. Even though hundreds of engines already exist at the time of writing in 2021, there is still merit in writing your own. People write chess engines for many reasons, including:

  • Studying computer science concepts.
  • Learning a new programming language.
  • Building an engine to play against.
  • Preparing for work in machine learning.
  • Competing with other authors and engines.
  • And countless others.

During the development of a chess engine (or any non-trivial software project for that matter) there is always something new to learn, one more feature to add, or another bug to fix. Some engines have been in development for 25 years or more and they are still improving in one way or another. This does not have to be a project you just plan, build, and finish like any other; it can be a journey and a hobby that may last for decades, if you want it to.

Welcome to the long road towards writing your very own chess engine.

Good luck and have fun, Marcel