import * from zerolife class LocalWorld(): def __init__ (self, x, y, startSpecies): self.board = [[None for y in range(y)] for x in range(x)] self.instructions = [[[None] for y in range(y)] for x in range(x)] def step(self): '''This is what is called to step the board. The intent is that the apply and get instructions methods are "private".''' self.__getInstructions__() self.__applyInstructions__() def __applyInstructions__(self): '''Takes the array of instructions and applies them to the board.''' for x in instructions: for y in x: vic = conflictResolver.victor(instructions[x][y]) if vic != None board[x][y] = vic def __getInstructions__(self): '''Iterates over the board and checks for instructions.''' self.tempInstructions = [] self.tempCoords = None for x in board: for y in x: tempInstructions.append(board[x][y].next(board, (x,y))) for instruc in tempInstructions: coords = instruc.coordinates instructions.[coords[x]][coords[y]].append(instruc) tempInstructions.pop()