So, I’ve actually decided to work on making my bot playable on a website since that was one of the main things people said they would have wanted last ship and stardance is ending soon. But thats not why I’m posting. I’m posting because I spent the last 40 minutes rooting out a bug that caused my premoves to not be played. My first step was playing the release version that can be downloaded to see if the bug was there as well. Luckily it wasn’t so I went to my current commit on my main branch and kepy undoing commits (and saving them with git stash) until the bug was gone. I then found that the bug only became a thing after I merged my commenting branch. Because of this I did the same thing of undoing commits and saving them on the commenting branch til I found the commit that caused the bug. I then went through all the changes until I found the problem. Then I fixed the bug, merged the fix to main then merged main into my other branches so that they would have the bug fix as well. I’ve already done some research and have found that pygbag seems to fit my needs for turning my pygame program into a website pretty well. Due to this I will probably use pygbag to get a website version of my chess bot up and running! Attached is a screenshot of the commit that caused the bug. Before the commit is on the left and after the commit is on the right. Try to find what caused the bug! If you can’t check the comments of the post as I am gonna say what the problem was there. I also attached a photo of how my git tree looks now and… it looks sooo messy lol.
Comments 1
The bug was caused because I added an else in line 88 which meant that the premoves were only played if the bot tries to make an illegal move, which firstly, could never happen and secondly, mean that even if I did manage to make a premove it would be illegal as I would have made 2 moves in a row.
Sign in to join the conversation.