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# (728.3 KB)
 
 
 
 
 
4 Star
(5)
34,870 times
Add to favorites
8/18/2018
E-mail Twitter del.icio.us 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:
      c2-c4,a7-a6
      d1-c2,g8-h6
      g1-f3,h8-g8
      c2-h7,f7-f6
      d2-d3,d7-d6
      c1-h6,c7-c5
      h7-g8   *taking the rook  ,c8-h3
      g2-h3   (blank black square now on g1) ,g7-h6
      d3-d4,h6-h5
      b1-c3,h5-h4
      c3-e4,a8-a7
      e4-c5,d6-c5
      e2-e4,d8-d7
      g8-g6+
      **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??
      Thanks!
      --Mike
    • 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
       
      else
      {
          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
      and
      // 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(m_FinishingRank.ToString());
          //Console.WriteLine(m_FinishingColumnNumber.ToString());
          //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");
          }
          else
          {
              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
    • http://stackoverflow.com/questions/10888391/link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-invalid-or-c
      
      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 http://www.codeproject.com/Articles/20736/C-C-CLI-Micro-Chess-Huo-Chess or at http://harmoniaphilosophica.wordpress.com/2011/09/28/how-to-develop-a-chess-program-for-2jszrulazj6wq-23/.
      
      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