def choose(situation, state):
    """Uses the given rule to decide whether to be 1 or 0 in the next round"""
    if situation == 3 and state == 0:
        return 1
    elif situation in [2, 3] and state == 1:
        return 1
    elif situation not in [2, 3] and state == 1:
        return 0
    else:
        return state