Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SmartRandomBots are not that smart after all #55

Open
Debilski opened this issue Jul 25, 2021 · 0 comments
Open

SmartRandomBots are not that smart after all #55

Debilski opened this issue Jul 25, 2021 · 0 comments

Comments

@Debilski
Copy link
Member

When a SmartRandomBot has visited all neighbouring positions, it will always chose the last on in sensible_positions, which puts it into a loop easily. I think initially we had some sort of least-recently-visited logic in there. Should we make it smarter or keep this as an educational bug. :)

else:
# all sensible positions are equally (un)interesting, so pick
# one that we haven't seen already
for next_pos in sensible_positions:
if next_pos not in bot.track:
break
# if we don't break out of the loop early it means that all new
# positions have been visited already, so we just pick the
# last one in the list
return next_pos

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

No branches or pull requests

1 participant