ABC — a chess programming book for beginners

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

User avatar
maksimKorzh
Posts: 779
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

ABC — a chess programming book for beginners

Post by maksimKorzh »

Hello everyone!

I’ve just finished a small project I’ve been working on: ABC (Array Based Chess).

The important part is that this is a book about building a chess engine, not simply a chess engine repository.

The book walks through the complete implementation of ABC, from the basics of board representation and 0x88 all the way to move generation, legality, perft, hashing, evaluation, quiescence search, negamax, iterative deepening, time management, and UCI communication.

The engine itself is intentionally simple and didactic. I’m not trying to compete with modern engines — the goal is to make the code understandable enough that someone can actually read it, experiment with it, break it, fix it, and eventually build their own engine.

The repository contains:

📖 the complete static HTML book
♟️ the ABC C source code covered throughout the book
🎮 example games, including games where ABC defeats TSCP

One of the main reasons I made this is that I wish I had something like it when I started chess programming nearly ten years ago. There is a lot of information about individual chess-programming techniques, but understanding how all those pieces fit together into one complete engine is a different challenge.

So this is my attempt to document that journey in one place.

The book is free, the code is free, and hopefully it will be useful to someone starting their own chess-programming journey.

Read book online: https://maksimkorzh.github.io/abc/
ABC source: https://github.com/maksimKorzh/abc

For CCRL testers:
Don't waste time testing it - it has a search very similar to TSCP and eval is a pure PeSTO approach, so it's like TSCP with PeSTO eval.
User avatar
Roland Chastain
Posts: 748
Joined: Sat Jun 08, 2013 10:07 am
Location: France
Full name: Roland Chastain

Re: ABC — a chess programming book for beginners

Post by Roland Chastain »

Hi Maksim!

Interesting project.

I read the first half of the book. I found the section on the chessboard representation (0x88) a bit brief. I had to consult other articles on the subject to fully understand it. For example, I wondered what value was assigned to the squares outside the board, until I realized that this value was never used. :)

The engine runs well. 8-)
Qui trop embrasse mal étreint.

Author of Eschecs, a simple UCI chess GUI written in Pascal.
User avatar
maksimKorzh
Posts: 779
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: ABC — a chess programming book for beginners

Post by maksimKorzh »

Hi Roland, thank you for your feedback and pull request on GitHub. I tried to focus on core parts assembling rather than explaining what is already explained on chess programming wiki.