Add Makefile shortcuts
This commit is contained in:
parent
e1ca503669
commit
4e44365aff
2 changed files with 24 additions and 0 deletions
12
2020/Makefile
Normal file
12
2020/Makefile
Normal file
|
|
@ -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 /_
|
||||||
12
2020/template.ex
Normal file
12
2020/template.ex
Normal file
|
|
@ -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()
|
||||||
Loading…
Reference in a new issue