chore: generate day 1 modules
This commit is contained in:
parent
07b2552249
commit
b4c93e39f4
4 changed files with 62 additions and 1 deletions
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
| S | M | T | W | T | F | S |
|
| S | M | T | W | T | F | S |
|
||||||
| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
|
| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
|
||||||
| | | | 1 | 2 | 3 | 4 |
|
| | | | [1] | 2 | 3 | 4 |
|
||||||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
|
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
|
||||||
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
|
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
|
||||||
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
|
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
|
||||||
|
@ -38,3 +38,5 @@ A behaviour for a solution to a puzzle. Must define a `solve/2` callback.
|
||||||
Case template defining an `assert_solution/2` helper.
|
Case template defining an `assert_solution/2` helper.
|
||||||
|
|
||||||
<!-- links -->
|
<!-- links -->
|
||||||
|
|
||||||
|
[1]: ./lib/advent_of_code/day01.ex
|
||||||
|
|
37
2021/lib/advent_of_code/day01.ex
Normal file
37
2021/lib/advent_of_code/day01.ex
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
defmodule AdventOfCode.Day01 do
|
||||||
|
@moduledoc """
|
||||||
|
Day 1
|
||||||
|
"""
|
||||||
|
end
|
||||||
|
|
||||||
|
defmodule AdventOfCode.Day01.Part1 do
|
||||||
|
@moduledoc """
|
||||||
|
Day 1, Part 1
|
||||||
|
"""
|
||||||
|
|
||||||
|
alias AdventOfCode.PuzzleSolver
|
||||||
|
use PuzzleSolver
|
||||||
|
|
||||||
|
import AdventOfCode.Day01, warn: false
|
||||||
|
|
||||||
|
@impl PuzzleSolver
|
||||||
|
def solve(_input_stream) do
|
||||||
|
:ok |> to_string()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defmodule AdventOfCode.Day01.Part2 do
|
||||||
|
@moduledoc """
|
||||||
|
Day 1, Part 2
|
||||||
|
"""
|
||||||
|
|
||||||
|
alias AdventOfCode.PuzzleSolver
|
||||||
|
use PuzzleSolver
|
||||||
|
|
||||||
|
import AdventOfCode.Day01, warn: false
|
||||||
|
|
||||||
|
@impl PuzzleSolver
|
||||||
|
def solve(_input_stream) do
|
||||||
|
:ok |> to_string()
|
||||||
|
end
|
||||||
|
end
|
11
2021/test/advent_of_code/day01/part_1_test.exs
Normal file
11
2021/test/advent_of_code/day01/part_1_test.exs
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
defmodule AdventOfCode.Day01.Part1Test do
|
||||||
|
use AdventOfCode.PuzzleCase, module: AdventOfCode.Day01.Part1
|
||||||
|
|
||||||
|
test "returns :ok" do
|
||||||
|
input = ~S"""
|
||||||
|
input
|
||||||
|
"""
|
||||||
|
|
||||||
|
assert_solution(input, "ok")
|
||||||
|
end
|
||||||
|
end
|
11
2021/test/advent_of_code/day01/part_2_test.exs
Normal file
11
2021/test/advent_of_code/day01/part_2_test.exs
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
defmodule AdventOfCode.Day01.Part2Test do
|
||||||
|
use AdventOfCode.PuzzleCase, module: AdventOfCode.Day01.Part2
|
||||||
|
|
||||||
|
test "returns :ok" do
|
||||||
|
input = ~S"""
|
||||||
|
input
|
||||||
|
"""
|
||||||
|
|
||||||
|
assert_solution(input, "ok")
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue