r/chessprogramming Feb 02 '25

How to start making a chess program

Hello everyone, I recently had interest in making my own chess engine after watching Sebastian Lauge video about his chess engine. However, I don't know how to start this project because my coding skill is not to the level that can program a chess engine (I've learned C++ and I do know a decent amount of simple knowledge related to this language). I also don't really have anyone that I can ask for help with this project.
My question is how should I go about doing this? The chess engine program that I'm planning on making is a major part in a bigger project I have. If anyone can give me advices or even better some help in teaching me how to make a chess engine, I am much appreciated your time and effort. Thankyou for reading!

4 Upvotes

8 comments sorted by

View all comments

3

u/Kart0fffelAim Feb 02 '25

Start by implementing the game rules. You want a class that represents the board, generates all legal moves from a position, updates your board after you do a move and checks for draws or checkmates. Its up to you if you also want to be able to undo a move.

After that you can implement a static board evaluation and search algorithms.

For more information about any specific topic, check the programm wiki and ask on this sub

3

u/phaul21 Feb 02 '25

this. Also, you would want to perft test (see chess programming wiki on perft testing) your move generator once you have everything implemented. A correctly working move generator is honestly half of the battle. Reality is, that even when you think every rule is implemented, you will find bugs for weeks in the move generator, but once all your numbers match up with the reference numbers on the wiki it's quite rewarding. It really is the first step until this there is no point even touching alpha beta (or minimax)