def initGrid(self):
blinker = [(<NUM_LIT:4>, <NUM_LIT:4>), (<NUM_LIT:4>, <NUM_LIT:5>), (<NUM_LIT:4>, <NUM_LIT:6>)]<EOL>toad = [(<NUM_LIT:9>, <NUM_LIT:5>), (<NUM_LIT:9>, <NUM_LIT:6>), (<NUM_LIT:9>, <NUM_LIT:7>), (<NUM_LIT:10>, <NUM_LIT:4>), (<NUM_LIT:10>, <NUM_LIT:5>), (<NUM_LIT:10>, <NUM_LIT:6>)]<EOL>glider = [(<NUM_LIT:4>, <NUM_LIT:11>), (<NUM_LIT:5>, <NUM_LIT:12>), (<NUM_LIT:6>, <NUM_LIT:10>), (<NUM_LIT:6>, <NUM_LIT:11>), (<NUM_LIT:6>, <NUM_LIT:12>)]<EOL>r_pentomino = [(<NUM_LIT:10>, <NUM_LIT>), (<NUM_LIT:9>, <NUM_LIT>), (<NUM_LIT:10>, <NUM_LIT>), (<NUM_LIT:11>, <NUM_LIT>), (<NUM_LIT:9>, <NUM_LIT>)]<EOL>self.grid = {}<EOL>if self.test:<EOL><INDENT>for cell in chain(blinker, toad, glider, r_pentomino):<EOL><INDENT>self.grid[cell] = <NUM_LIT:1><EOL><DEDENT><DEDENT>else:<EOL><INDENT>for _ in range(self.initsize):<EOL><INDENT>ry = random.randint(self.y_pad, self.y_grid - <NUM_LIT:1>)<EOL>rx = random.randint(self.x_pad, self.x_grid - <NUM_LIT:1>)<EOL>self.grid[(ry, rx)] = <NUM_LIT:1><EOL><DEDENT><DEDENT>
Initialise the game grid