
Huo Chess – Fix on checking for checks
The most interesting and annoying bugs are the obvious ones.
When the computer starts analyzing the current situation, the code checks for the existence of checks in the chessboard. This check for checks is performed via the function called ‘CheckForWhiteCheck’ (for white) or ‘CheckForBlackCheck’ (for black).
The problem in the existing code should be obvious from the snippet put in the beginning of the post: The check is performed with the wrong function in case the computer plays with white (i.e. in the case the player color is black).
The correct code should read:
if (m_PlayerColor.CompareTo("White") == 0)
ThereIsCheck = CheckForBlackCheck(Skakiera_Thinking);
else if (m_PlayerColor.CompareTo("Black") == 0)
ThereIsCheck = CheckForWhiteCheck(Skakiera_Thinking);
Next release will include the fix.
Leave a comment