Changeset 51:995c5300f498
- Timestamp:
- 12/19/10 23:48:39 (5 years ago)
- Branch:
- default
- Children:
- 53:91160a357d1a, 57:2f62804e21fc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
snake.py
r49 r51 €а 39 39 break€а 40 40 assert line == '', "Rules must be separated by empty lines"€а 41 €а self.rules.append(Rule( ).load(file))€а€а 41 self.rules.append(Rule(self).load(file))€а 42 42 €а 43 43 def fill (self):€а тАж тАж €а 89 89 """€а 90 90 assert char.lower() in self.codes, "Illegal symbol in rule: %s" % char€а 91 €а cell = engine.Cell(x, y, None)€а€а 91 cell = engine.Cell(x, y, self.snake)€а 92 92 if char in 'htb':€а 93 93 if char.islower():€а 94 €а cell.snake = 'my'€а€а 94 cell.snake_type = 'my'€а 95 95 else:€а 96 €а cell.snake = 'enemy'€а€а 96 cell.snake_type = 'enemy'€а 97 97 if char == 'h':€а 98 98 assert (x, y) == (3, 3), "Own head must in the center of rule"€а
Note: See TracChangeset
for help on using the changeset viewer.