Board.IsDraw() not working in Version 1.17
See original GitHub issueHow to reproduce in version 1.17:
public Move Think(Board board, Timer timer)
{
// some calculation to find the bestMove (board is fully reset to its original state after this)
board.MakeMove(bestMove);
if (board.IsDraw())
Console.WriteLine("ABOUT TO MAKE A MOVE THAT RESULTS IN A DRAW.");
board.UndoMove(bestMove);
return bestMove;
}
Expected behaviour: Whenever the AI makes a move that results in a draw, we should see “ABOUT TO MAKE A MOVE THAT RESULTS IN A DRAW.” in the console
Current behaviour: The debug message never shows up in the console even if the next turn results in a draw. The play-out altorithm catches the draw, but you can’t check for a draw in the Think function. As it is not currently possible to detect a draw, my AIs love spinning in circles and producing one tie after another. 😄
Human error? I’m wondering if there is anything on my end that I might be doing wrong? If you have any ideas, please let me know, but I think the code example shown above is fairly waterproof, right? We should see the debug message if the game is about to result in a draw, but we don’t.
Thanks for having a look! 😃
Issue Analytics
- State:
- Created 2 months ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
One move early makes perfect sense cause the AIs will just keep spinning in circles otherwise anyways. Excellent.
I just tested it out and it now works as expected. So I can confirm that the issues has been resolved! Thanks a lot.
I hope you know how much joy you bring people with this little competition. This is so much fun. I am totally addicted. Haha. Thanks agian. Keep up the great work! ❤️
Thanks for bringing this to my attention @LooveToLoose, I have just uploaded a patch for this bug. Please note – in case you haven’t seen it in the docs – that you will get the ‘results in draw’ message one move early, but this is intended behaviour in this API: