c# 2.0 chess project

Talking about chess programming using C#.

Friday, October 22, 2004

Step one: - Getting started

It's really incredible the amount of work it takes to write a chess program in ANY language. If you are using a new language (or beta in the case of c# 2.0), you are obviously going to spend a lot of time getting yourself acquainted with the language features. By far though, you will probably spend most of your time researching stuff about computer chess. There is plenty of stuff available on the internet. The trick is to find it. You should start with articles giving a general overview on chess programming. Perhaps the best is the series of articles written by François Dominic Laramée at gamedev.net.

There are some good technical papers available at Professor Bob Hyatt (the creator of Crafty) site. If you are ever going to succeed in implementing rotated bitboards by yourself without checking out any available source code (No need for that really. You can always read the source for my program), then this is the place to start. Be sure to download a copy of Crafty while you are at it and also get a copy of winboard. Details on how to hook it up to Crafty are available here.

The Hyatt papers were all I really needed to get a rotated bitboard implementation working. For another approach to move generation, check out Nagaskaki by Neels Groenewald and the various tips on his page. Once you got move generation working, you will probably spend the rest of the time on game searching algorithms. A good intro is the series of articles by Bruce Moreland. You should also check out a description of Negascout, MTD and verified null move pruning. Once you get deep into getting an efficient algorithm working, you should also take a look at Ed Schroeder's article , "How Rebel Plays Chess".
I just discovered a huge cache of articles on chess programming recently, available at http://digilander.libero.it/gargamellachess/papers.htm . I'm still wading through it all but already some it looks pretty useful.

That's all for now. I promise to have that source code up pretty soon.

Wednesday, October 20, 2004

first post - what this blog is about

Hello. This blog will detail my efforts to write a chess program in C# 2.0 comparable in strength to popular engines like Crafty and Rebel. I will post stuff about move generation using rotated bitboards, move pruning and C# specific issues with performance I encounter while writing this program. My primary motivation? Well, I am something of a chess nut and writing a chess program is something I have always wanted to do. It's not trivial and finding ways to tweak your program to provide great performance can keep you occupied for years. I decided to use C# 2.0 for the following reasons:

a) There are no chess engines coded in C# or any other modern object oriented language that I am aware of (no strong chess engines anyway). All the really strong engines are coded in C.
b) I am curious about finding out if I can tweak a chess engine written in C# to provide the kind of performance you normally get with a similar engine written in C or C++.
c) It's fun!

I started coding up my engine around the start of July 2004. I submitted a half finished entry to Microsoft's summer of express competition. Of course I didn't win (who would with a half finished program?) but if they live up to their promise, they will be posting the submitted code soon. It should provide a stark contrast to the current status of the program (I will post the updated code in a couple of days). I got the move generation and basic book building worked out. Right now, I'm beating my brains out over producing a reasonable search and evaluation function.

Oh, about me. Just graduated from UMASS Boston with a MS in Computer Science this summer. I live in Boston and my day job involves ASP.NET programming.