1
0
Fork 0
advent-of-code/2021/lib/advent_of_code/puzzle_solver.ex
Sloane Perrault a691461882 Setup 2021 (#1)
* chore: scaffold project

* chore: stand up puzzle solver, puzzle case

* feat: solution runner

* feat: solution generator
2022-09-21 09:19:53 -04:00

18 lines
388 B
Elixir

defmodule AdventOfCode.PuzzleSolver do
@moduledoc """
Behaviour for a puzzle solution.
"""
@doc """
Given the input as a stream, return the solution as a string
"""
@callback solve(Enumerable.t()) :: String.t()
def solve(mod, stream), do: apply(mod, :solve, [stream])
defmacro __using__(_) do
quote do
@behaviour AdventOfCode.PuzzleSolver
end
end
end