Exemple #1
0
    def test_orbit_chain(self):
        """()"""
        data = data_input("data/aoc_06_data_test_2.txt")
        orbits = calc_orbits(data)
        result = orbit_chain(orbits, "YOU", [])
        self.assertEqual(result, ["K", "J", "E", "D", "C", "B", "COM"])

        data = data_input("data/aoc_06_data_test_2.txt")
        orbits = calc_orbits(data)
        result = orbit_chain(orbits, "SAN", [])
        self.assertEqual(result, ["I", "D", "C", "B", "COM"])
Exemple #2
0
def main() -> None:
    data: str = data_input("data/aoc_06_data.txt")

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

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

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

    # Part 2
    p_2 = part_2(data)
    print(f"Part 2: {p_2} is {p_2 == 2392}")
Exemple #4
0
 def test_part_1(self):
     """"""
     data: List[int] = data_input("data/aoc_06_data_test.txt")
     self.assertEqual(part_1(data), 5)
Exemple #5
0
 def test_orbit_counter(self):
     """()"""
     data = data_input("data/aoc_06_data_test_1.txt")
     orbits = calc_orbits(data)
     result = orbit_counter(orbits, "D", 0)
     self.assertEqual(result, 3)
Exemple #6
0
 def test_part_2(self):
     """()"""
     data = data_input("data/aoc_06_data_test_2.txt")
     result = part_2(data)
     self.assertEqual(result, 4)
Exemple #7
0
"""
    aoc_06
    https://adventofcode.com/2017/day/6
"""

from typing import List
from libs.aoc_06_lib import data_input, part_1, part_2

DATA: List[int] = data_input("data/aoc_06_data.txt")

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

# Part 2
PART_2: int = part_2(DATA)
print(f"Part 2: {PART_2} is {PART_2 == 2392}")
 def test_part_2(self):
     """"""
     data = data_input("data/aoc_06_data_test.txt")
     self.assertEqual(part_2(data), 4)