예제 #1
0
def test_closest():
    coordinates = [(3, 3), (2, 0), (2, 6)]
    print(useful.passes(True, adventday6.closest((0, 3), (3, 3), coordinates)))
    print(useful.passes(False, adventday6.closest((1, 1), (3, 3),
                                                  coordinates)))
    print(useful.passes(False, adventday6.closest((1, 1), (0, 0),
                                                  coordinates)))
예제 #2
0
def test_area():
    coordinates = [(1, 1), (1, 6), (8, 3), (3, 4), (5, 5), (8, 9)]
    area_dict = {
        (1, 1): 7,
        (1, 6): 9,
        (8, 3): 12,
        (3, 4): 9,
        (5, 5): 17,
        (8, 9): 10,
    }
    print(useful.passes(area_dict, adventday6.area(coordinates)))
예제 #3
0
def test_location():
    print(useful.passes((1, 3), adventday6.location("1, 3")))
    print(useful.passes((0, 0), adventday6.location("0, 0")))
예제 #4
0
def test_closer():
    print(useful.passes(-1, adventday6.closer((1, 3), (0, 0), (5, 4))))
    print(useful.passes(1, adventday6.closer((1, 3), (5, 4), (0, 0))))
    print(useful.passes(0, adventday6.closer((1, 3), (0, 0), (3, 5))))
예제 #5
0
def test_distance():
    print(useful.passes(4, adventday6.distance((1, 3), (0, 0))))
예제 #6
0
def test_tuple_list():
    print(
        useful.passes([(1, 3), (0, 0)], adventday6.tuple_list(["1, 3",
                                                               "0, 0"])))