Add Optional "Debug-Mode" to beatBruteBot.py#1
Conversation
|
Hi, @FedeCuci , Those are awesome features, and thanks for your contribution! I'll test the code with my bots and merge the PR after that. |
Celqaz
left a comment
There was a problem hiding this comment.
Hi @FedeCuci ,
Thank you for your contribution!
I have completed the review for the PR and left my feedback. If you have any questions or need further clarification, please feel free to reach out.
Cheers to the New Year!
Kind regards,
Bin Li
| self.overlap.append('S') | ||
| self.map[currentPosition[0]][currentPosition[1]] = 'S' | ||
| else: | ||
| self.map[currentPosition[0]][currentPosition[1]] = self.overlap[self.overlap.index(self.currentSign) + 1] |
There was a problem hiding this comment.
Since the value of self.botPosition has been updated in the previous moveRobot function in Map class, currentPosition no longer equals to self.botPosition:
currentPosition: the position before the move;self.botPosition: the latest position after the move.
Here, we are trying to use the sign of the self.botPosition to update the value of the currentPosition, which may lead to unintended behaviours:
In future adjustments, we might need to use the same position variable.
There was a problem hiding this comment.
I see, this is a good find. Is this the new Map.py file that Paris uploaded?
There was a problem hiding this comment.
Yea, I think I have adopted the latest version of the Map.py. You can run with the RandomBot to reproduce this issue and debug.
These minor changes are based on our [previous discussion](https://github.com/Celqaz/beatBruteBot/pull/1/files#r1438395842)
Celqaz
left a comment
There was a problem hiding this comment.
Hi @FedeCuci , I apologize for the delay; it's been a somewhat chaotic semester that I've just managed to get through. I hope you understand.
Regarding the PR, I have completed the review and addressed the minor issues we discussed. At the moment, there is only one remaining issue that needs to be fixed, and you can find instructions on how to reproduce it in my comment. Once we resolve this issue, the PR will be ready to merge. Thank you once again for your effort and contribution.
| self.overlap.append('S') | ||
| self.map[currentPosition[0]][currentPosition[1]] = 'S' | ||
| else: | ||
| self.map[currentPosition[0]][currentPosition[1]] = self.overlap[self.overlap.index(self.currentSign) + 1] |
There was a problem hiding this comment.
Yea, I think I have adopted the latest version of the Map.py. You can run with the RandomBot to reproduce this issue and debug.
Hey @Celqaz I have edited your automation script so that users have the choice to "debug" maps that their bot is not able to complete. This is done by pressing
ENTERfor each move, so that the user has more control over how they check how their bot behaves. If a user is stuck and is done debugging a certain map, any key can be pressed to start debugging the next map.Also, every position that the bot has been in is marked with a number, which signifies the number of times the bot has been in that particular cell. This is only done until the number 9, as double-digit numbers would alter the outline of the map. Therefore, if the bot has visited a cell more than nine times, the cell is replaced with an "S", which stands for "Stuck".
Although a minor change, I found that being able to debug my bot following every iteration has helped me a lot. The changes do not force the user to debug, but rather give them a choice so that it is not too intrusive. Would you mind checking the new steps I have added in the Readme.md and letting me know if you are able to reproduce them? Also, let me know if the script works fine with your bot too! If so, I think this would be a nice addition.
For the future, it might be best to just include the new
Game.pyandMap.pyfiles instead of having so many additions in theReadme.md.