question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Board.IsDraw() not working in Version 1.17

See original GitHub issue

How 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:closed
  • Created 2 months ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
LooveToLoosecommented, Jul 30, 2023

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! ❤️

0reactions
SebLaguecommented, Jul 30, 2023

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:

Note: this function will return true if the same position has occurred twice on the board (rather than 3 times,
which is when the game is actually drawn). This quirk is to help bots avoid repeating positions unnecessarily.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Items Shadowing not working 1.17.1 - update supressor is ...
1 on pc and I am using Sensei's* update supressor which works fine in my version; I can create floating sand, cacti, banners,...
Read more >
LooveToLoose
Day of Week August Aug August Aug Sunday Sun No contributions on Sunday, July 31, 2022 No contributions on Sunday, Au... Monday Mon No contributions...
Read more >
Forge not working with Optifine on Minecraft 1.17.1 ... - YouTube
(see here: https://github.com/sp614x/optifine/ issues /6126 ) HOWEVER! ... The latest version fixes the bugs Step three: Download optifabric ...
Read more >
How do I fix Minecraft 1.17 OpenGL error? - Old School Gamers
Start up Minecraft. Open the Options menu in the main menu. If you're already inside a World, open the game menu using the...
Read more >
Mineshafter not working on any snapshot of 1.17
Alright here is the solution that worked for me. MAKE SURE TO HAVE JAVA 8 ALREADY TO DO THIS -. Open Command Prompt....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found