def explore_state(state, world, player):
    while (len(state.avail_doors) > 0):
        door = state.next_avail_door().door
        connect_region = world.get_entrance(door.name, player).connected_region
        if (state.can_traverse(door) and (not state.visited(connect_region)) and valid_region_to_explore(connect_region, world, player)):
            state.visit_region(connect_region)
            state.add_all_doors_check_unattached(connect_region, world, player)
def explore_state(state, world, player):
    while (len(state.avail_doors) > 0):
        door = state.next_avail_door().door
        connect_region = world.get_entrance(door.name, player).connected_region
        if (state.can_traverse(door) and (not state.visited(connect_region)) and valid_region_to_explore(connect_region, world, player)):
            state.visit_region(connect_region)
            state.add_all_doors_check_unattached(connect_region, world, player)