def next_state(state):
    width = len(state[:])
    height = len(state[:][:])
    test_state = dead_state(width, height)
    for i in range(len(state[:])):
        for j in range(len(state[i][:])):
            if (state[i][j] == 1):
                test_state[i][j] = alive_cell(i, j, state)
            else:
                test_state[i][j] = dead_cell(i, j, state)
    return test_state
def next_state(state):
    width = len(state[:])
    height = len(state[:][:])
    test_state = dead_state(width, height)
    for i in range(len(state[:])):
        for j in range(len(state[i][:])):
            if (state[i][j] == 1):
                test_state[i][j] = alive_cell(i, j, state)
            else:
                test_state[i][j] = dead_cell(i, j, state)
    return test_state