Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/snake/annotate/b2eaeeb74d87/snake.py
Дата изменения: Unknown
Дата индексирования: Fri Feb 28 20:49:35 2014
Кодировка:
snake: snake.py annotate

snake

annotate snake.py @ 32:b2eaeeb74d87

fixed lots of small errors
author Alex Martynov <martiran@kodomo.fbb.msu.ru>
date Sun, 19 Dec 2010 19:22:49 +0300
parents 76d0514d1ef9
children 17f615088ed6
rev   line source
martiran@30 1 class Snake(object):
martiran@30 2 def __init__ (self, cells, color):
martiran@32 3 self.cells = cells
martiran@32 4 self.color = color
martiran@32 5 self.rules = []
martiran@32 6 pass
martiran@30 7 def load (self, file):
martiran@30 8
martiran@32 9 pass
martiran@30 10 def fill (self):
martiran@30 11 for cell in self.cells:
martiran@32 12 cell.snake = self
martiran@32 13 snake.cells[0].type = 'head'
martiran@31 14 snake.cells[-1].type = 'tail'
martiran@31 15 snake.cells[1:-1].type = 'body'
martiran@31 16 return
martiran@31 17
martiran@30 18
martiran@30 19 class Rule(object):
martiran@30 20 def __init__ (self, snake):
martiran@32 21 self.snake = snake
martiran@32 22 self.direction = (1, -1)
martiran@32 23 pass
martiran@30 24 def load (self, file):
martiran@32 25
martiran@32 26 pass
martiran@30 27 def applies (self, field, x, y):
martiran@32 28
martiran@32 29 pass
martiran@30 30 def rotate (self, rot):
martiran@32 31 pass
martiran@30 32