diff --git a/2024/python/src/grice_py_aoc_2024/templates/main.py-tpl b/2024/python/src/grice_py_aoc_2024/templates/main.py-tpl index 1d1613a..883e4b5 100644 --- a/2024/python/src/grice_py_aoc_2024/templates/main.py-tpl +++ b/2024/python/src/grice_py_aoc_2024/templates/main.py-tpl @@ -7,24 +7,28 @@ DIR = Path(__file__).parent FILE = DIR.parents[3] / "inputs" / f"{DIR.stem}.txt" -def part1(contents: str): - return "Not done yet!" +def part1(contents: str) -> int: + total = 0 + # TODO part 1 + return total -def part2(contents: str): - return "Not done yet!" +def part2(contents: str) -> int: + total = 0 + # TODO part 2 + return total def main(): contents = FILE.read_text() _start1 = time.perf_counter() - result1 = part1(contents) + result1 = part1(contents=contents) _delta1 = time.perf_counter() - _start1 print(f">> Part 1: {result1} ({_delta1:.6f}s)") _start2 = time.perf_counter() - result2 = part2(contents) + result2 = part2(contents=contents) _delta2 = time.perf_counter() - _start2 print(f">> Part 2: {result2} ({_delta2:.6f}s)") diff --git a/2024/python/src/grice_py_aoc_2024/templates/test_day.py-tpl b/2024/python/src/grice_py_aoc_2024/templates/test_day.py-tpl index d1220ef..8754248 100644 --- a/2024/python/src/grice_py_aoc_2024/templates/test_day.py-tpl +++ b/2024/python/src/grice_py_aoc_2024/templates/test_day.py-tpl @@ -8,18 +8,18 @@ from .main import part1, part2 DIR = Path(__file__).parent TEST_FILE = DIR.parents[3] / "inputs/tests" / f"test_{DIR.stem}.txt" -EXPECTED_PART_1 = "REPLACE ME!" -EXPECTED_PART_2 = "REPLACE ME!" +EXPECTED_PART_1 = 123 # TODO replace! +EXPECTED_PART_2 = 456 # TODO replace! def test_part1(): contents = TEST_FILE.read_text() - result = part1(contents) + result = part1(contents=contents) assert result == EXPECTED_PART_1 @pytest.mark.xfail(reason=f"{DIR.stem} P1 incomplete") def test_part2(): contents = TEST_FILE.read_text() - result = part2(contents) + result = part2(contents=contents) assert result == EXPECTED_PART_2