Search Wiki:

IMPORTANT UPDATE: This code samples page is now obsolete! Find the newer versions of Huo Chess at or at See a detailed explanation of the Huo Chess algorithm at

Huo Chess - XNA Edition

Brief Description
Huo Chess is an open source micro chess program developed by Spiros I. Kakos. This project is the XNA Edition of Huo Chess. Graphical User Interface capabilities were added to the existing Huo Chess AI engine. Mouse and keyboard user input are supported.
The code is heavily commented so as to help other programmers or chess enthusiasts understand the underlying logic of the chess AI. Please refer to the official pages of Huo Chess C++ ( and C# ( versions for in-depth details on the chess engine algorithm.

For games played by Huo Chess and for an analytical explanation of its underlying logic, see (that page refers to the Huo Chess C++ version, however it applies to the C# XNA edition as well)

For a tutorial on how to develop a chess software application on your own see the How to Develop a Chess Program for Dummies tutorial at This tutorial is based on the Huo Chess and it is written by the creator of Huo Chess himself.

How to customize
You can change the CountScore function so as to alter the way the computer AI evaluates the chess board positions. For example if you change the value of the pawns from 1 to 2, then the program AI will value pawns more.
You can also use the Huo Chess Opening Book Edition to create your personalized Opening Book for Huo Chess. You can find the Opening Book Editor at at the MSDN Huo Chess C++ edition home page. The folder with the opening book entries must be in the same folder as the Huo Chess executable (see the Huo Chess Opening Book Editor page for more instructions).
Last edited Sep 28 2011 at 4:44 PM  by Kakos, version 16
Kakos wrote  Feb 1 2009 at 11:39 AM  



Date: 2009-01-25
Place: Athens, Greece
White: Microchess (as provided by BenLo Park)
Black: HuoChess v0.82 (with Opening Book)
Result: Draw by threefold repetition

1. e4 e6
2. Qh5 Qe7
3. Bc4 Kd8
4. d4 a6
5. Bf4 d5
6. exd5 f5
7. dxe6 Bxe6
8. Bxe6 g6
9. Qe2 Nd7
10. Bxc7+ Kxc7
11. Qc4+ Nc5
12. dxc5 Qg7
13. Qf4+ Kc6
14. Qf3+ Kxc5
15. Qd5+ Kb6
16. Qb3+ Kc7
17. Qc4+ Kd6
18. Qd5+ Kc7
19. Qc4+ Kd6
20. Qd5+ Kc7
21. Qc4+ Kd6
22. Qd5+ draw by threefold repetition

Huo Chess played a good game. It did not give up pieces without reason and did not lose chances to kill opponent’s pieces when possible.

Page view tracker