Line 104: |
Line 104: |
| return [column, row] | | return [column, row] |
| | | |
| + | n = int(uniform(0, 6)) |
| + | for i in range(6): |
| + | column = turtle[0] + CIRCLE[evenodd][(i + n) % 6][0] |
| + | row = turtle[1] + CIRCLE[evenodd][(i + n) % 6][1] |
| + | if not self._dots[self._grid_to_dot((column, row))].type: |
| + | self._orientation = (i + n) % 6 |
| + | return [column, row] |
| + | return turtle |
| + | </pre> |
| + | |
| + | If it tries to continue in the direction it was already heading, the turtle is harder to catch. |
| + | |
| + | <pre> |
| + | def _turtle_strategy(self, turtle): |
| + | evenodd = turtle[1] % 2 |
| + | column = turtle[0] + CIRCLE[evenodd][self._orientation][0] |
| + | row = turtle[1] + CIRCLE[evenodd][self._orientation][1] |
| + | if not self._dots[self._grid_to_dot((col, row))].type: |
| + | return [col, row] |
| n = int(uniform(0, 6)) | | n = int(uniform(0, 6)) |
| for i in range(6): | | for i in range(6): |