1
0
Fork 0
advent-of-code/2021/lib/AOCHelpers.ex
2022-09-21 09:19:53 -04:00

16 lines
378 B
Elixir

defmodule AOCHelpers do
defmacro __using__(_) do
quote do
def input_number_list(sep \\ ",") do
input_string()
|> String.trim()
|> String.split(sep)
|> Enum.map(&String.to_integer/1)
end
def iterate(times, start, fun) do
Enum.reduce(1..times, start, fn _, current -> fun.(current) end)
end
end
end
end