Huo Chess by Spiros (Spyridon) Kakos (
http://www.kakos.com.gr) is a free and fully open source micro chess program in CLI C++ v8.0 that attempts to be smaller in size than the Commodore-era Microchess. The goal is to create the smallest chess program that exists. More versions are to come in the future. I started developing the program in CLI C++ v8.0 (with Visual Studio 2008) and I named it "Huo Chess" for personal reasons.
Please visit http://code.msdn.microsoft.com/cshuochess for the C# Edition of Huo Chess (available also as open source).Please visit http://code.msdn.microsoft.com/vbhuochess for the Visual Basic Edition of Huo Chess (available also as open source).Please visit http://code.msdn.microsoft.com/xnahuochess for the XNA Edition of Huo Chess with Graphical User Interface. Currently Huo Chess version 0.81 is
61.5 KB in size, while Huo Chess 0.6 (micro edition) is only
47.5 KB in size. The new version 0.82 (available only in C# edition up to now) is
52.5 KB in size. The respective emulation of Microchess (the first microchess from the Commodore era) in C is 56 KB.
However, it must be noted that
the original Microchess, written in pure Assembly, was about 1 KB (http://www.benlo.com/microchess/microchess1.html)…something I believe no one will ever match!.
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.
For games played by Huo Chess and for an
analytical explanation of its underlying logic, see
http://www.codeproject.com/KB/game/cpp_microchess.aspx.
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).
IMPORTANT NOTE by Author [Spyridon I. Kakos]: Huo Chess is intelligently designed, but it also evolves. The current version is stable. If you happen to play with Huo Chess and find any problems, make sure to tell me so that I can see what the problem is and try to fix it. Thanks in advance for your feedback and comments!