1
0
Fork 0

wip: 2015 day 15

This commit is contained in:
Sloane Perrault 2022-09-21 09:19:53 -04:00
parent d583b073d4
commit 210ff58be5

26
2015/lib/2015/15.ex Normal file
View file

@ -0,0 +1,26 @@
import AOC
aoc 2015, 15 do
def parse_ingredient(str) do
[name | properties] =
Regex.run(
~r/(\w+): capacity (-?\d+), durability (-?\d+), flavor (-?\d+), texture (-?\d+), calories (-?\d+)$/,
str,
capture: :all_but_first
)
[capacity, durability, flavor, texture, calories] =
properties |> Enum.map(&String.to_integer/1)
{name, [capacity, durability, flavor, texture], calories}
end
def p1 do
input_stream()
|> Stream.map(&parse_ingredient/1)
|> Enum.to_list()
end
def p2 do
end
end