diff --git a/2020/Makefile b/2020/Makefile new file mode 100644 index 0000000..bf9b59a --- /dev/null +++ b/2020/Makefile @@ -0,0 +1,12 @@ +.DEFAULT_GOAL=day +DAY=0 + +.PHONY: day +day: + mkdir 'day$(DAY)' + sed 's/DayX/Day$(DAY)/g' template.ex > 'day$(DAY)/day$(DAY).ex' + touch 'day$(DAY)/input' + +.PHONY: watch +watch: + ls 'day$(DAY)/day$(DAY).ex' | entr -c elixir /_ diff --git a/2020/template.ex b/2020/template.ex new file mode 100644 index 0000000..373f617 --- /dev/null +++ b/2020/template.ex @@ -0,0 +1,12 @@ +defmodule DayX do + defp read_input do + Path.expand('input', Path.dirname(__ENV__.file)) + |> File.read!() + end + + def part1 do + read_input() + end +end + +DayX.part1() |> IO.inspect()