-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
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. :)
pelita_template/demo03_smartrandom.py
Lines 44 to 54 in c600a75
| 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 |
Metadata
Metadata
Assignees
Labels
No labels