Implement 2024 day 17 part 1

This commit is contained in:
2024-12-17 09:55:07 +01:00
parent 17017e7ab4
commit 6c0a49a5f3
4 changed files with 83 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
Register A: 729
Register B: 0
Register C: 0
Program: 0,1,5,4,3,0

View File

@@ -14,3 +14,14 @@ from . import get_data
)
def test_sample_part1(data: str, result: int) -> None:
assert DayRunner.part1(data) == result
@pytest.mark.parametrize(
"data,result",
[
(get_data(16, 1), 45),
(get_data(16, 2), 64),
],
)
def test_sample_part2(data: str, result: int) -> None:
assert DayRunner.part2(data) == result

7
2024/tests/test_day17.py Normal file
View File

@@ -0,0 +1,7 @@
from aoc.days.day17 import DayRunner
from . import get_data
def test_sample_part1() -> None:
assert DayRunner.part1(get_data(17)) == "4,6,3,5,6,3,5,2,1,0"