From fe9216ef5abf27f360a57cc3fd601988fec2eabd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Dec 2024 04:17:55 +0000 Subject: [PATCH] feat(2024): init day 06 --- 2024/Day06/README.md | 3 +++ 2024/Day06/input.txt | 0 2024/Day06/input_test.txt | 0 2024/Day06/main.py | 16 ++++++++++++++++ 2024/Day06/solutions.py | 6 ++++++ 2024/Day06/test_solutions.py | 30 ++++++++++++++++++++++++++++++ 6 files changed, 55 insertions(+) create mode 100644 2024/Day06/README.md create mode 100644 2024/Day06/input.txt create mode 100644 2024/Day06/input_test.txt create mode 100644 2024/Day06/main.py create mode 100644 2024/Day06/solutions.py create mode 100644 2024/Day06/test_solutions.py diff --git a/2024/Day06/README.md b/2024/Day06/README.md new file mode 100644 index 0000000..98e93b9 --- /dev/null +++ b/2024/Day06/README.md @@ -0,0 +1,3 @@ +# --- Day 0: Template --- + +To be used as template for the other days. diff --git a/2024/Day06/input.txt b/2024/Day06/input.txt new file mode 100644 index 0000000..e69de29 diff --git a/2024/Day06/input_test.txt b/2024/Day06/input_test.txt new file mode 100644 index 0000000..e69de29 diff --git a/2024/Day06/main.py b/2024/Day06/main.py new file mode 100644 index 0000000..b728c56 --- /dev/null +++ b/2024/Day06/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/Day06/solutions.py b/2024/Day06/solutions.py new file mode 100644 index 0000000..fda2aae --- /dev/null +++ b/2024/Day06/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/Day06/test_solutions.py b/2024/Day06/test_solutions.py new file mode 100644 index 0000000..ed7fdb1 --- /dev/null +++ b/2024/Day06/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