Changeset 108:d29a90f5095d
- Timestamp:
- 12/20/10 12:13:11 (5 years ago)
- Branch:
- default
- Children:
- 110:763c07539658, 111:9486211ec334
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
engine.py
r107 r108 €а 148 148 def legal_moves(self, snake):€а 149 149 snake.legal_dir = []€а €а 150 head = snake.cells[0]€а 150 151 for direction in directions:€а 151 €а dir_cell = self.field[ snake.cells[0].y + direction[0], snake.cells[0].x+ direction[1]]€а€а 152 dir_cell = self.field[head.x + direction[0], head.y + direction[1]]€а 152 153 if (dir_cell.type == 'empty' or (dir_cell.type == 'tail' and dir_cell.snake != snake)):€а 153 154 snake.legal_dir.append(direction)€а
Note: See TracChangeset
for help on using the changeset viewer.