Exemple #1
0
def main() -> None:
    data = data_input("data/aoc_11_data.txt")

    # Part 1
    p_1 = part_1(data)
    print(f"Part 1: {p_1} is {p_1 == 329}")

    # Part 2
    p_2 = part_2(data)
    print(f"Part 2: {p_2} is {p_2 == 329}")
Exemple #2
0
def main() -> None:
    data = data_input("data/aoc_07_data.txt")

    # Part 1
    p_1 = part_1(data)
    print(f"Part 1: {p_1} is {p_1 == 19650}")

    # Part 2
    p_2 = part_2(data)
    print(f"Part 2: {p_2} is {p_2 == 35961106}")
Exemple #3
0
def main() -> None:
    data = data_input("data/aoc_09_data.txt")

    # Part 1
    inpt: int = 1
    p_1 = part_1(data, inpt)
    print(f"Part 1: {p_1} is {p_1 == 3780860499}")

    # Part 2
    inpt: int = 2
    p_2 = part_2(data, inpt)
    print(f"Part 2: {p_2} is {p_2 == 33343}")
Exemple #4
0
def main() -> None:
    data = data_input("data/aoc_05_data.txt")

    # Part 1
    id_1: int = 1
    p_1 = part_1(data, id_1)
    print(f"Part 1: {p_1} is {p_1 == 11933517}")

    # Part 2
    id_2: int = 5
    p_2 = part_2(data, id_2)
    print(f"Part 2: {p_2} is {p_2 == 10428568}")
Exemple #5
0
def main() -> None:
    data = data_input("data/aoc_02_data.txt")

    # Part 1
    noun: int = 12
    verb: int = 2
    p_1: int = part_1(data, noun, verb)
    print(f"Part 1: {p_1} is {p_1 == 3562672}")

    # Part 2
    output: int = 19690720
    p_2: int = part_2(data, output)
    print(f"Part 2: {p_2} is {p_2 == 8250}")
    def test_thruster_signal(self):
        """()"""
        data = data_input("data/aoc_07_data_test_1.txt")
        phases: List[int] = [4, 3, 2, 1, 0]
        system = AmplifierSystem(data, phases)
        result = system.thruster_signal()
        exp_result: int = 43210
        self.assertEqual(result, exp_result)

        data = data_input("data/aoc_07_data_test_2.txt")
        phases: List[int] = [0, 1, 2, 3, 4]
        system = AmplifierSystem(data, phases)
        result = system.thruster_signal()
        exp_result: int = 54321
        self.assertEqual(result, exp_result)

        data = data_input("data/aoc_07_data_test_3.txt")
        phases: List[int] = [1, 0, 4, 3, 2]
        system = AmplifierSystem(data, phases)
        result = system.thruster_signal()
        exp_result: int = 65210
        self.assertEqual(result, exp_result)

        data = data_input("data/aoc_07_data_test_4.txt")
        phases: List[int] = [9, 8, 7, 6, 5]
        system = AmplifierSystem(data, phases)
        result = system.thruster_signal()
        exp_result: int = 139629729
        self.assertEqual(result, exp_result)

        data = data_input("data/aoc_07_data_test_5.txt")
        phases: List[int] = [9, 7, 8, 5, 6]
        system = AmplifierSystem(data, phases)
        result = system.thruster_signal()
        exp_result: int = 18216
        self.assertEqual(result, exp_result)
 def test_part_1(self):
     data = data_input("data/aoc_11_data_test.txt") + [0]*100
     result = part_1(data, grid_size=5)
     self.assertEqual(result, 6)
Exemple #8
0
def main() -> None:
    intcode_computer_software = data_input("data/aoc_13_data.txt")

    # Part 1
    p_1 = part_1(intcode_computer_software)
    print(f"Part 1: {p_1} is {p_1 == 10198}")