Skip to content

2024

Chess: the chess piece

The Chess Piece

Part of the How to Program a Chess Engine in Lisp series.

Donald Knuth is credited with the statement:

...We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%.

Chess programming is most assuredly in the 3%! Our challenge in this series will be to strike a reasonable balance between efficiency and clarity. Our first opportunity to that end is the chess piece.

Here is the source for piece.rkt

How to Program a Chess Engine in Lisp

Last updated 2024-11-29 18:48

Table of Contents

  1. The Chess Piece
  2. The Chess Board
  3. FEN - Forsyth-Edwards Notation
  4. The Chess Move
  5. Move Generation

Introduction

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.