Use Livebook to open this notebook and explore new ideas.
It is easy to get started, on your machine or the cloud.
# AOC 2022 - Day 12
```elixir
Mix.install([
{:kino_aoc, "~> 0.1"}
])
```
## AOC Helper
<!-- livebook:{"attrs":{"assign_to":"puzzle_input","day":"12","session_secret":"AOC_SESSION","year":"2022"},"chunks":null,"kind":"Elixir.KinoAOC.HelperCell","livebook_object":"smart_cell"} -->
```elixir
{:ok, puzzle_input} =
KinoAOC.download_puzzle("2022", "12", System.fetch_env!("LB_AOC_SESSION"))
```
<!-- livebook:{"branch_parent_index":0} -->
## Part 1
## Code
```elixir
defmodule PartOne do
def solve(input) do
IO.puts("--- Part One ---")
IO.puts("Result: #{run(input)}")
end
def run(input) do
end
end
```
## Test
```elixir
ExUnit.start(autorun: false)
defmodule PartOneTest do
use ExUnit.Case, async: true
import PartOne
@input ""
@expected nil
test "part one" do
actual = run(@input)
assert actual == @expected
end
end
ExUnit.run()
```
## Solution
```elixir
PartOne.solve(puzzle_input)
```
<!-- livebook:{"branch_parent_index":4} -->
## Part 2
## Code
```elixir
defmodule PartTwo do
def solve(input) do
IO.puts("--- Part Two ---")
IO.puts("Result: #{run(input)}")
end
def run(input) do
end
end
```
## Test
```elixir
ExUnit.start(autorun: false)
defmodule PartTwoTest do
use ExUnit.Case, async: true
import PartTwo
@input ""
@expected nil
test "part two" do
actual = run(@input)
assert actual == @expected
end
end
ExUnit.run()
```
## Solution
```elixir
PartTwo.solve(puzzle_input)
```
<!-- livebook:{"offset":1483,"stamp":{"token":"XCP.YiNweQA41LRdjh3keJTAugSvHTv_LyDV27dquA4-t7jN5IdTLMahE455xl2AvXDEoKR_7rnAr-UxO5BUXa-UQgSaGI-Bv1pXIKa56aT72_HiJuSnlq8","version":2}} -->
See source