Huo Chess (C# micro chess)

Huo Chess by Spiros Kakos is a free and fully open source micro chess program that attempts to be smaller in size than the Commodore-era Microchess. The goal is to create the smallest chess program that exists. Heavily commented code helps everyone build their own chess.

C# (4.1 MB)
4 Star
35,222 times
Add to favorites
E-mail Twitter Digg Facebook
Sign in to ask a question

  • Great Program well done!
    2 Posts | Last post August 02, 2018
    • It is a nice program you wrote, I just notice that later in the program i had a blank block on g1 and then it took my queen on g6 ??
      Not sure it it is a bug please see the game log:
      h7-g8   *taking the rook  ,c8-h3
      g2-h3   (blank black square now on g1) ,g7-h6
      **error happen g1 * g6   (g1 is an empty square)
    • Thanks for the feedback. Will check it out and get back to you!
  • I noticed bishop jumping back and forth..
    2 Posts | Last post August 02, 2018
    • Good example of chess. However, need a lot of work on.. Good luck! :)
    • Thanks. Yes, indeed it needs work and I try to constantly update it!
  • Great Job
    2 Posts | Last post November 13, 2013
    • Thanks for your code!Good sample 
    • Nice sample!
  • enpassant does not work
    2 Posts | Last post March 12, 2013
    • Hi, I noticed enpassant does not work.
      I played two games and both times when the computer pushed their pawn up two squares passed by pawn it said Invalid Move! when I tried to take their pawn.
      Can we get this bug fixed??
    • You are right. There is indeed a problem there. I will embed the fix in the next version. In the meanwhile, do the following to get it fixed:
      1. In the ElegxosNomimotitas (check legality of the move) function:
      Remove the
          if((m_FinishingRank != enpassant_possible_target_rank) || (m_FinishingColumnNumber != enpassant_possible_target_column))
              Nomimotita = false;
      code. Do that for both
      // eat forward to the right
      // eat forward to the right
      segments and for both pawns (white and black).
      2. In the ElegxosOrthotitas (check correctness of the move) function change the
      // En Passant eat forward to the left
      segment as follows:
      // En Passant eat forward to the left
      else if ((m_FinishingRank == (m_StartingRank + 1)) && (m_FinishingColumnNumber == (m_StartingColumnNumber - 1)))
          //Console.WriteLine("checking En passant...");
          if ((m_FinishingRank == 6) && (EOSkakiera[(m_FinishingColumnNumber - 1), (4)].CompareTo("Black Pawn") == 0))
              Orthotita = true;
              enpassant_occured = true;
              EOSkakiera[(m_FinishingColumnNumber - 1), (m_FinishingRank - 1 - 1)] = "";
              //Console.WriteLine("En passant true");
              Orthotita = false;
              enpassant_occured = false;
      It seems that I had wrong column numbers checking when checking the correctnes of the move.
      You should do that change however for both pawns (white and black). And you should do that for all possible en passant moves (eating forward to the right, eating backwards to the left et cetera).
      I tried the code and it worked.
      Tell me how it goes. And thanks for the comment!  
  • C++ Build Failed
    2 Posts | Last post November 20, 2012
    • 1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
      I get this error when I attempt to build. Is this an environment setup issue? Any ideas?
      I will post again if I find the solution.
      Thanks, Todd
      There is a known issue with compiling VC++ solutions with VS2010 and VS2012 side-by-side.  I resolved this issue and was able to compile in VS2010 by unistalling VS2012 completely, uninstalling/re-installing VS2010 completely and installing VS2010 SP1.
      Thanks, Todd
  • Impossible to read
    2 Posts | Last post August 29, 2012
    • I just downloaded the C# sample but I gave it up on trying to understand how it works because all of the code is placed in a single class which is 5600 lines... and I don't have time to refactor it...
    • The program is divided into separate functions all with informative names and comments inside them. Given the fact that I have also published tutorials on how the code works (where I also mention the flow of the application), I cannot agree with your comment. What do you mean "refractor it"? All chess programs are complicated and cannot be understood in a glance. Especially other programs which do not have as much comments as mine and CERTAINLY no tutorials published about them...
      See a tutorial at or at
      If you have any specific question I would be happy to answer it.
      Thanks for your comment.
  • where is the XNA code for graphical representation of chess??
    2 Posts | Last post May 05, 2012
    • hi,
      i cudnt get the graphical representation of chess.
      can you plz help me with it.
      i want the code with the help of which i can run this chess program with graphics.
      kindly help.
      waiting for ur reply eagerly.
    • Hi. Did you try to compile and run the XNA version? It resides in a folder in the C# version. Tell me if that works.
  • Visual
    2 Posts | Last post February 27, 2012
    • I want to use this game for my school project but I need to have a visual view from the chess board,
      I can't find how to open that, is that because it's not possible or because I do something wrong?
    • You have to see the XNA example for that.
  • Great Job!
    2 Posts | Last post February 05, 2012
    • Excellent samples!!! Great job!! Keep up the great work!
    • Thanks! I am trying to make a new update as soon as possible!
  • Questions about Huo Chess
    1 Posts | Last post October 03, 2011
    • Feel free to ask me questions about Huo Chess, chess engine algorithms or C# programming.
      Spiros Kakos