コード例 #1
0
    def test_part_2(self):
        universe = data_input("data/aoc_12_data_test_1.txt")
        result = part_2(universe)
        self.assertEqual(result, 2772)

        universe = data_input("data/aoc_12_data_test_2.txt")
        result = part_2(universe)
        self.assertEqual(result, 4686774924)
コード例 #2
0
def main() -> None:
    data = data_input("data/aoc_12_data.txt")

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

    # Part 2
    p_2 = part_2(data)
    print(f"Part 2: {p_2} is {p_2 == 211}")
コード例 #3
0
 def test_part_2(self):
     """"""
     data = data_input("data/aoc_12_data_test.txt")
     self.assertEqual(part_2(data), 2)
コード例 #4
0
"""
    aoc_12
    https://adventofcode.com/2017/day/12
"""

from libs.aoc_12_lib import data_input, part_1, part_2


DATA: str = data_input("data/aoc_12_data.txt")

# Part 1
PART_1: int = part_1(DATA)
print(f"Part 1: {PART_1} is {PART_1 == 288}")

# Part 2
PART_2: int = part_2(DATA)
print(f"Part 2: {PART_2} is {PART_2 == 211}")