SharpChess - C# Chess Game


If you're enjoying SharpChess, then perhaps $5 isn't a lot to ask? Thank you, Peter Hughes.

History of SharpChess


I first laid statement to source code during a two week holiday of Christmas 2003, although I had been considering how cool it would be to actually write a program that could play chess, for a number of years.

I was discussing the "challenge" of chess programming with a friend of mine, Chizzy, and came to the conclusion that if you could assign scores to board positions and then run through all your possible moves, and for each of your moves try all the enemy's moves (and so on), you could then simply select the move that had the best score!

Enthused by my "new" idea, I had been looking for a good juicy project to try out this new-fangled C# programming language, that everyone seemed to be raving about.

Given that C# was marketed as "fully object-oriented", I decided that I should try to write the program in the most truly object-oriented manner I could muster. I found that the task of representing the real-world concepts of chess in terms of objects came together suprisingly easily, and was very rewarding. I quickly had the basic classes of Board, Square, Piece, Player, Game and Move. In the first couple of days, I had a fully working graphical chess board that highlighted the legal moves for all various pieces. By the third day, I was able to play a game of chess, while I made the moves for both sides. By the end of the first week I had my initial AI algorithm working, and the program was playing at around 2-3 ply strength in a thinking time of 30 seconds per move.

It was around this time that I first considered looking on the internet to see if anyone else had submitted ideas about writing chess programs!

I came across MinMax

My eyes were opened.

It turned out that "my algorithm" actually had an offical name: "MinMax". Not only that, but MinMax was mearly a first-step in designing chess engines. I quickly learned about alpha-beta, hash-tables, and all the other programming techniques that go into making a decent chess engine. Since then, I've spent my time tweaking, beating, and in some cases, swearing at the source code of SharpChess in an almost ceasless endevour to improve its playing strength.

I have to say, that I have now become a chess-programming addict.

I hope you enjoy SharpChess.

Peter Hughes
SourceForge.net Logo
Valid XHTML 1.1!
|
Valid CSS!
|
Level Triple-A conformance icon, W3C-WAI Web Content
|
126654 visitors have visited 4444 times, since 1 Nov 2004.
Copyright Peter Hughes 2010
info@sharpchess.com