# normal play starts here if not initialise: # define cell for clicked cell cell = board.cell_board[row][col] # calling methods based on player choice if left_click == 1 and not cell.flagged(): if not cell.opened(): board.open_cell(row, col) else: board.open_neighbours(row, col) elif right_click == 1 and not cell.opened(): board.flag_cell(row, col) # blit text for each cell for i in range(0, size): for j in range(0, size): # define new cell here, since we are looking at every single cell cell = board.cell_board[i][j] color = lightgrey y = (cell_len + margin) * i + cell_len / 2 + margin x = (cell_len + margin) * j + cell_len / 2 + margin # draw value if opened if cell.opened(): # print("Index {}, {} is opened".format(i, j)) number = cell.value()