def run_lights(): """ Create the initial representation of the grid and start the display. """ grid = [[random.choice([ON, OFF]) for j in range(SIZE)] for i in range(SIZE)] # start display cell_size = 40 run_display(grid, cell_size, on_click)
def make_grid(DIMENSIONS): grid = [] for l in range(DIMENSIONS): row=[] for n in range(DIMENSIONS): color = random.choice([4,7]) row.append(color) grid.append(row) # display the grid cell_size = 100 run_display(grid, cell_size, on_click)
def make_grid(): grid = [] for l in range(6): row=[] for n in range(7): color = 9 row.append(color) grid.append(row) # display the grid cell_size = 100 run_display(grid, cell_size, on_click, 6)