mix format
This commit is contained in:
parent
fda0c5af94
commit
0c2d682398
2 changed files with 7 additions and 5 deletions
|
@ -1,8 +1,6 @@
|
|||
import Integer, only: [mod: 2]
|
||||
|
||||
defmodule Day10 do
|
||||
@behaviour Solution
|
||||
|
||||
def init_state(p) when p == :part1 do
|
||||
%{vm: VirtualMachine.new(), acc: 0, p: p}
|
||||
end
|
||||
|
|
|
@ -11,13 +11,17 @@ defmodule Mix.Tasks.GetInput do
|
|||
def run(args) do
|
||||
[year, day] = args
|
||||
write_file = &File.write("./input/#{year}_#{day}.txt", &1)
|
||||
HTTPoison.start
|
||||
HTTPoison.start()
|
||||
|
||||
HTTPoison.get!(
|
||||
"https://adventofcode.com/#{year}/day/#{day}/input",
|
||||
get_request_headers()
|
||||
)
|
||||
|> Map.get(:body)
|
||||
|> then(fn i -> IO.puts(i); i end)
|
||||
|> Map.get(:body)
|
||||
|> then(fn i ->
|
||||
IO.puts(i)
|
||||
i
|
||||
end)
|
||||
|> write_file.()
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue