diff --git a/lib/advent_code2024/day1.ex b/lib/advent_code2024/day1.ex index e8f8cfc..2cd17ad 100644 --- a/lib/advent_code2024/day1.ex +++ b/lib/advent_code2024/day1.ex @@ -1,4 +1,5 @@ defmodule AdventCode2024.Day1 do + @behaviour AdventCode2024.Solution @moduledoc """ Solution for Advent of Code 2024 - Day 1: Historian Hysteria diff --git a/lib/advent_code2024/solution.ex b/lib/advent_code2024/solution.ex new file mode 100644 index 0000000..ce10e68 --- /dev/null +++ b/lib/advent_code2024/solution.ex @@ -0,0 +1,29 @@ +defmodule AdventCode2024.Solution do + @moduledoc """ + Behaviour module defining the interface for Advent of Code daily solutions. + """ + + @doc """ + Solves Part 1 of a daily challenge. + + ## Parameters + - input_file: Path to input file + + ## Returns + - `{:ok, result}` where result is the solution + - `{:error, reason}` if processing fails + """ + @callback solve(input_file :: String.t()) :: {:ok, any()} | {:error, String.t()} + + @doc """ + Solves Part 2 of a daily challenge. + + ## Parameters + - input_file: Path to input file + + ## Returns + - `{:ok, result}` where result is the solution + - `{:error, reason}` if processing fails + """ + @callback solve_part2(input_file :: String.t()) :: {:ok, any()} | {:error, String.t()} +end