Advertisement
Guest User

Untitled

a guest
Apr 28th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1.  
  2.  
  3. class Field(object):
  4. '''
  5. classdocs
  6. '''
  7.  
  8. TRACK = 0
  9. CAR = 1
  10. WALL = 2
  11. FINISH = 3
  12. CHECKPOINT1 = 4
  13. CHECKPOINT2 = 5
  14.  
  15.  
  16. def __init__(self, width, height):
  17. '''
  18. Constructor
  19. '''
  20. self.height = height
  21. self.width = width
  22. self.field = [None] * height
  23. for i in range(height):
  24. self.field[i] = [None] * width
  25.  
  26.  
  27. def setstate(self, state, x, y):
  28.  
  29. self.field[y][x] = state
  30.  
  31. def getstate(self, x, y):
  32.  
  33. return self.field[y][x]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement