Пример #1
0
    def main():
        code = load_int_list("input/d05.txt")
        inp = [1]
        output = []
        compute(copy.copy(code), inp=inp, output=output)
        print("Air con:")
        for out in output:
            print(out)

        inp = [5]
        output = []
        compute(copy.copy(code), inp=inp, output=output)
        print("Radiators:")
        for out in output:
            print(out)
Пример #2
0
 def test_detect_floats(self):
     with self.assertRaises(ValueError) as context:
         load_int_list(GetTestFilePath("input/intLIst/hasFloat"))
Пример #3
0
 def test_load_negativeInts(self):
     ints = load_int_list(GetTestFilePath("input/intLIst/negativeInts"))
     self.assertListEqual(
         ints, [
             50962, 126857, -127476, 136169, -62054, 116866, 123235])
Пример #4
0
 def test_load_ints(self):
     ints = load_int_list(GetTestFilePath("input/intLIst/123"))
     self.assertListEqual(ints, [1, 2, 3])
Пример #5
0
 def main():
     ages = load_int_list("input/d06.txt")
     print(part_one(ages, 80))
     print(part_one(ages, 256))
Пример #6
0
 def main():
     positions = load_int_list("input/d07.txt")
     print(part_one(positions))
     print(part_two(positions))
Пример #7
0
 def main():
     program = load_int_list("input/d02.txt")
     fixup_1202(program)
     compute(program)
     print(program[0])
     print(find_and_encode(19690720))
Пример #8
0
 def __init__(self):
     self.base_program = encode(load_int_list(make_path("input/d02.txt")))
Пример #9
0
    def main():
        code = load_int_list("input/d07.txt")
        print("Max thrust: {0}".format(find_max_thrust(code)))

        print("Max Feedback thrust: {0}".format(
            find_max_feedback_thrust(code)))