def determine_init_crystal(initial, state, start_regions):
    if initial:
        return CrystalBarrier.Orange
    if (state is None):
        raise Exception('Please start path checking from the entrances')
    if (len(start_regions) > 1):
        raise NotImplementedError('Path checking for multiple start regions (not the entrances) not implemented, use more paths instead')
    start_region = start_regions[0]
    if ((start_region in state.visited_blue) and (start_region in state.visited_orange)):
        return CrystalBarrier.Either
    elif (start_region in state.visited_blue):
        return CrystalBarrier.Blue
    elif (start_region in state.visited_orange):
        return CrystalBarrier.Orange
    else:
        raise Exception("Can't get to %s from initial state", start_region.name)
def determine_init_crystal(initial, state, start_regions):
    if initial:
        return CrystalBarrier.Orange
    if (state is None):
        raise Exception('Please start path checking from the entrances')
    if (len(start_regions) > 1):
        raise NotImplementedError('Path checking for multiple start regions (not the entrances) not implemented, use more paths instead')
    start_region = start_regions[0]
    if ((start_region in state.visited_blue) and (start_region in state.visited_orange)):
        return CrystalBarrier.Either
    elif (start_region in state.visited_blue):
        return CrystalBarrier.Blue
    elif (start_region in state.visited_orange):
        return CrystalBarrier.Orange
    else:
        raise Exception("Can't get to %s from initial state", start_region.name)