DEV Community

Cover image for Chess Engine in C #0: Intro
Victor Chigbo
Victor Chigbo

Posted on

Chess Engine in C #0: Intro

This project is something I picked up from Codecrafters' Build Your Own X repository. It's something I want to use to understand low-level and systems programming in C, build my consistency muscle, and just get better at the things I do as a techie.

The project instructions is based a 107-video Youtube playlist, totalling at approximately 15 hours(At the end of this, I'll add the total time I've spent on the project too ๐Ÿ˜…). I started this project in the early hours of Easter Sunday, 2026, and so far this is what I've learnt from it:

  1. UCI Protocol: UCI stands for Universal Chess Interface and this is a open, text-based communication protocol that enables chess engines
    to communicate with GUIs.

  2. Files and Ranks: Files are columns that go up and down the chessboard, and each board has eight of them, labelled from a to h while ranks are rows that go from side to side across the chessboard and are referred to by numbers 1 to 8. Together, they can be used to identify squares on the chessboard and track movements of pieces too. A popular naming convention used in the game of chess is the file-first method, where a square is identified by it's file, then it's rank. For example, the lower right-hand square is h1, which means, 'h-file, first rank'.

Files and Ranks of a chessboard

Niche Rules

In the second video, there are three niche moves that we have to consider while making the chess engine. They are:
a. Fifty Moves: The fifty-move rule in chess states that a player can claim a draw if no capture has been made and no pawn has been moved in the last fifty moves.
b. Threefold Repetition: The threefold repetition rule states that if a game reaches the same position three times, a draw can be claimed.
c. En Passant: En passant ("in passing") is a special chess pawn capture that occurs when a pawn moves two squares forward from its starting position and lands immediately adjacent to an opponentโ€™s pawn.

En Passant

So yeah. That's it for now! As always, if you want to see the Github repo, you can click here.

Until the next commit....bye ๐Ÿ‘‹

Top comments (0)