Saturday, September 22, 2007

What programming language to use?

90% of the chess engines are programmed in c or c++. So that if you know these languages, no problem, use them for your engine, as you will find plenty of exemples and people to help you during your long quest. The remaining 10% are divided into the other languages (i.e java, c#, basic,...). Here I suggest visual basic or c# if you are a strong beginner (i.e. you are not starting from zero). You could download SharpDevelop which is a free programming interface using c# and visual basic, equivalent to MS visual studio (having also a free version). Once downloaded and installed, as well as the MS Framework 2, open a new visual basic console project (create it in
a new directory with a nice name (the same as your engine). You are on the good way if you are here ;-)

Saturday, September 15, 2007

The structure of the programme

Here we describe what is required for your programme to work.
  1. A board representation : your programme needs to know where the different pieces are. The board will be an array of integers.
  2. A move generator : now that your creation can view the board, you have to make the moves by displacing the different pieces
  3. Communication with a GUI (Winboard). You will be proud to see the baby playing moves on already existing free Graphic User Interface. It is rather easy to do something working not that bad
  4. The chess search algorithm. Here it will be the Alpha-Beta amelioration of MiniMax algorithm. The thinking process. Calling Alpha-Beta, how to stop the search, aspiration window,...
  5. The evaluation function : the position is good or not? It is a good question. Quiescence search is also a good choice

Chess programming for beginners

You will find some good places on the Web if you want to start your own chess engine (I know it is a strange idea, but if you are here you are a strange person). As you don't want to create a clone, i.e. take sources codes, modify a few lines, compile the thing, and finally say "that's my baby, i'm the strongest programmer on the world", you will have to do it yourself, and do it the hardest way.
I will try to give you some basic techniques in the following small articles. If you are already inside chess programming, I suppose you will not find this place so interesting, though my feedback on some classical algorithms may be sometime original. Do not try to send me mail if you have some questions, better to post on the chess programming forums, Talkchess and Winboard (links on the right).