def random_state(width, height):
    state = dead_state(width, height)
    for i in range(width):
        for j in range(height):
            state[i][j] = (1 if (random.random() >= 0.5) else 0)
    return state
def random_state(width, height):
    state = dead_state(width, height)
    for i in range(width):
        for j in range(height):
            state[i][j] = (1 if (random.random() >= 0.5) else 0)
    return state