MadChess 3.0 Beta 2d855ec (Crash Bug)

I found and exterminated a bug that caused MadChess to crash in about one quarter of one percent of games. I noticed the engine crashes on line 6 of this code in the Board.IsMoveLegal(ref ulong Move) method. First Hypothesis : Illegal Move Causing King Capture? I suspected the crash was caused by kingSquare == Square.Illegal (meaning king not on any square) due to a missing king. Perhaps a move two ply earlier exposed its own king to check, MadChess erroneously considered the move legal, then captured the king the previous ply? If that were true, in the current ply, when… Continue Reading

MadChess 2.0 Beta Build 027 (Draw By Repetition Bug)

Yes! I found and exterminated the bug I mentioned in my previous post. I corrected a bug that caused MadChess to play a losing move in a drawn by repetition position. MadChess evaluates the first repetition of a position as drawn, even though the rules of chess state the second repetition is drawn. This search optimization avoids wasting a ply to determine the position is drawn by repetition. MadChess’ recursive search method checks if a position is repeated before searching any moves. If the position is a repeat of an earlier position, the search returns a zero score. I forgot… Continue Reading