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

snake

annotate engine.py @ 2:597c0ddea0ab

check automatic close, close #6
author Alex Martynov <martiran@kodomo.fbb.msu.ru>
date Wed, 08 Dec 2010 02:17:48 +0300
parents 97e55c13fbda
children f1a508e855ce
rev   line source
martiran@1 1 class Cell (object):
martiran@1 2 def __init__ (self, x, y, canvas):
martiran@1 3 self.x = x
martiran@1 4 self.y = y
martiran@1 5 self.canvas = canvas
martiran@1 6 self.snake = None
martiran@1 7 self.type = empty
martiran@1 8 return
martiran@1 9 def redraw (w, h):
martiran@1 10 pass
martiran@1 11 def __eq__ (pattern):
martiran@1 12 pass
martiran@1 13 def clear ():
martiran@1 14 self.snake = None
martiran@1 15 self.type = 'empty'
martiran@1 16 return
martiran@1 17
martiran@1 18
martiran@1 19 class Engine (object):
martiran@2 20 def __init__ (canvas, w, h, snake_amount = 4):
martiran@1 21 self.canvas = canvas
martiran@1 22 self.w = w
martiran@1 23 self.h = h
martiran@1 24 self.snake_amount = snake_amount
martiran@1 25 self.snakes = []
martiran@1 26 self.field = '?'
martiran@1 27 return
martiran@1 28 def step():
martiran@1 29 pass
martiran@1 30 def move_snake():
martiran@1 31 pass
martiran@1 32 def create_snake (snake_number):
martiran@1 33 pass
martiran@1 34 def refill():
martiran@1 35 pass
martiran@1 36 def redraw (w,h):
martiran@1 37 pass
martiran@1 38 def legal_moves (snake):
martiran@1 39 pass
martiran@1 40