Skip to content

Add Optional "Debug-Mode" to beatBruteBot.py#1

Open
FedeCuci wants to merge 5 commits into
Celqaz:mainfrom
FedeCuci:debug-mode
Open

Add Optional "Debug-Mode" to beatBruteBot.py#1
FedeCuci wants to merge 5 commits into
Celqaz:mainfrom
FedeCuci:debug-mode

Conversation

@FedeCuci

@FedeCuci FedeCuci commented Dec 2, 2023

Copy link
Copy Markdown

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 ENTER for 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.py and Map.py files instead of having so many additions in the Readme.md.

@Celqaz

Celqaz commented Dec 4, 2023

Copy link
Copy Markdown
Owner

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.

Comment thread .gitignore Outdated
Comment thread README.md
Comment thread README.md
Comment thread README.md

@Celqaz Celqaz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread README.md
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]

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Possible Error_1 Possible Error_2

In future adjustments, we might need to use the same position variable.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, this is a good find. Is this the new Map.py file that Paris uploaded?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread README.md
Comment thread README.md Outdated

@Celqaz Celqaz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread README.md
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]

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants