Search Wiki:

C# Micro Chess (Huo Chess)

C# Micro Chess is a free and fully open source chess engine. The C# Micro Chess presented in this page is a C# port of the Huo Chess engine (http://code.msdn.com/huochess). Huo Chess is developed and maintained by Spiros (Spyridon) Kakos (http://www.kakos.com.gr).

Currently C# Micro Chess (Huo Chess) is at version 0.721 at a total of 53.5 KB in size.
Huo Chess plays decent chess and has managed to draw Microchess, but unfortunately will probably lose if it plays with Garry Kasparov :)
Its algorithm can be used to study the underlying logic of a chess program or as a basis for your own chess program. The source code is fully available and heavily commented.

The algorithm used in this program for the implementation of the computer thinking is the "Brute Force Algorithm." Huo Chess plays with the material in mind, while its code has some hints of positional strategic playing embedded. More analytically: When the program starts thinking, it scans the chessboard to find where its pieces are (see ComputerMove function) and then tries all possible moves it can make. It analyzes these moves up to the thinking depth I have defined (via the ComputerMove -> HumanMove -> ComputerMove2 path), measures the score (see CountScore function) of the final position reached from all possible move variants and – finally – chooses the move that leads to the most promising (from a score point of view) position (ComputerMove function).
Check http://www.codeproject.com/KB/cpp/cpp_microchess.aspx to see details about the Huo Chess algorithm (that page refers to the Huo Chess C++ version, however it applies to the C# version as well).

Huo to customize: Use Microsoft Visual Studio 2008 to customize the code. The program has an opening book capability, which means that anyone can optimize the program by adding his/her own opening moves data in the respective folder Huo Chess Opening Book (which should be in the same directory with the executable). You can also add more thinking depth capability, by adding new ComputerMove functions (like ComputerMove2, ComputerMove4 etc.), change the value of ThinkingDepth variable and make the necessary adjustments to the HumanMove function (add another if at the point where it calls the ComputerMove functions). Moreover, you can also optimize the way Huo Chess thinks by changing the CountScore function and the way the computer values the pieces or the chessboard position. For example, if you change the score of the Queen in the CountScore function from 9 to 12, then the HY will play aggressively to attack the opponent's queen and at the same time try harder to defend its own queen. You can also — for example — give a high scoring to the existence of an opening column with a rook controlling it, so as to make the computer play more with its rooks and try to take over columns with them. Any FEEDBACK is WELCOME with better configurations of the Opening Book or the CountScore function!
Last edited Jul 8 at 1:30 PM  by Kakos, version 8
Updating...
Page view tracker