def live(board):
    N = len(board)
acells = {}
for i in range(N):
    for j in range(N):
        if board[i][j] == 'x':
            for x, y in neighbors(i, j, N):
                if (x, y) not in acells:
                    acells[x, y] = board[x][y]
while True:
    pass
Game Of Life: как следить за активными ячейками