daily log 10.10.20

less than 1 minute read

        for point in points:
            x_start = point[0]
            x_end = point[1]

                    if len(points) == 1:
            return 1
        
        for i,(x_start,x_end) in enumerate(points):
            non_self = points
            del non_self[i]
            print(non_self)
            for j,(xj_start, xj_end) in enumerate(non_self):
                # print('comparing', x_start, xj_start, x_end, xj_end)
                print('comparing', x_start, x_end, ':', xj_start, xj_end)
                # if (x_start > xj_start) and (x_) :
                #     print('too big')
                # if x_end
                # print(x_start, x_end)

Much better

        if len(points) == 1:
            return 1
        
        for i,(x_start,x_end) in enumerate(points):
            for j,(xj_start, xj_end) in enumerate(points):
                if i != j:
                    
                # print('comparing', x_start, xj_start, x_end, xj_end)
                    print('comparing', x_start, x_end, ':', xj_start, xj_end)
        for i,(x_start,x_end) in enumerate(points):
            for j,(xj_start, xj_end) in enumerate(points):
                if i != j:
                    if (((x_start > xj_start) and (x_end < xj_end)) 
                        or ((x_start < xj_start) and (x_end > xj_end)))  :
                        print('no overlap')
                    else:
                        print('comparing', x_start, x_end, ':', xj_start, xj_end)

        if len(points) == 1:
            return 1
        
        for i,(x_start,x_end) in enumerate(points):
            for j,(xj_start, xj_end) in enumerate(points):
                if i != j:
                    if (((x_start > xj_start) and (x_start > xj_end)) 
                        or ((x_start < xj_start) and (x_start < xj_end))):
                        print('no overlap')
                    else:
                        print('comparing', x_start, x_end, ':', xj_start, xj_end)