diff --git a/2024/Day07/README.md b/2024/Day07/README.md new file mode 100644 index 0000000..98e93b9 --- /dev/null +++ b/2024/Day07/README.md @@ -0,0 +1,3 @@ +# --- Day 0: Template --- + +To be used as template for the other days. diff --git a/2024/Day07/input.txt b/2024/Day07/input.txt new file mode 100644 index 0000000..e69de29 diff --git a/2024/Day07/input_test.txt b/2024/Day07/input_test.txt new file mode 100644 index 0000000..e69de29 diff --git a/2024/Day07/main.py b/2024/Day07/main.py new file mode 100644 index 0000000..b728c56 --- /dev/null +++ b/2024/Day07/main.py @@ -0,0 +1,16 @@ +import os +import sys + +sys.path.append(".") + +from solutions import part1, part2 + +from utils.inputs import get_inputs +from utils.timings import profile_run + +if __name__ == "__main__": + input_path = f"{os.path.dirname(os.path.realpath(__file__))}/input.txt" + inputs = get_inputs(input_path) + + profile_run("Part 1", lambda: part1(inputs)) + profile_run("Part 2", lambda: part2(inputs)) diff --git a/2024/Day07/solutions.py b/2024/Day07/solutions.py new file mode 100644 index 0000000..fda2aae --- /dev/null +++ b/2024/Day07/solutions.py @@ -0,0 +1,6 @@ +def part1(inputs: list[str]) -> int: + return 1 + + +def part2(inputs: list[str]) -> int: + return 2 diff --git a/2024/Day07/test_solutions.py b/2024/Day07/test_solutions.py new file mode 100644 index 0000000..ed7fdb1 --- /dev/null +++ b/2024/Day07/test_solutions.py @@ -0,0 +1,30 @@ +import os + +import pytest +from solutions import part1, part2 + +from utils.inputs import get_inputs + +current_dir = os.path.dirname(os.path.realpath(__file__)) + +input = get_inputs(f"{current_dir}/input.txt") +input_test = get_inputs(f"{current_dir}/input_test.txt") + + +class TestPart1: + def test_with_test_data(self): + assert part1(input_test) == 1 + + @pytest.mark.skip(reason="not implemented") + def test_with_real_data(self): + assert part1(input) == 1 + + +class TestPart2: + @pytest.mark.skip(reason="not implemented") + def test_with_test_data(self): + assert part2(input_test) == 2 + + @pytest.mark.skip(reason="not implemented") + def test_with_real_data(self): + assert part2(input) == 2