feat: Add Solution behaviour for standardizing Advent of Code daily solutions

This commit is contained in:
Ruidy (aider) 2024-12-01 18:01:41 +01:00
parent 9869ade615
commit 85ebc05ead
No known key found for this signature in database
GPG key ID: E00F51288CB857CC
2 changed files with 30 additions and 0 deletions

View file

@ -1,4 +1,5 @@
defmodule AdventCode2024.Day1 do defmodule AdventCode2024.Day1 do
@behaviour AdventCode2024.Solution
@moduledoc """ @moduledoc """
Solution for Advent of Code 2024 - Day 1: Historian Hysteria Solution for Advent of Code 2024 - Day 1: Historian Hysteria

View file

@ -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