To run a particular solution call aoc:solve/2
with the day
and the part specified. The day is an atom like day1
and the
part is either p1
for part one or p2
for part two.
The output from each solution identifies which day and part ran, the output for that problem, and the time it took to run.
To run all the solutions call aoc:solve_all()
.
Start by cloning the repo and running rebar3 shell
for a REPL.
aoc:solve_all() = [
{day1,p1,54990,{0.672,ms}},
{day1,p2,54473,{0.872,ms}},
{day2,p1,2810,{0.016,ms}},
{day2,p2,69110,{0.032,ms}},
{day3,p1,528819,{0.816,ms}},
{day3,p2,80403602,{0.851,ms}},
{day4,p1,21485,{3.059,ms}},
{day4,p2,11024379,{3.0,ms}}}
].
aoc:solve(day1, p1) = {day1,p1,54990,{1.093,ms}}.
{Day, Part, Answer, Runtime} = aoc:solve(day1, p1),
Day = day1,
Part = p1,
Answer = 54990,
Runtime = {1.093,ms}.
To develop with an open REPL call r3:compile()
from within
the REPL to reload code with updates from your editor.
% Reload code and re-run all solutions
r3:compile(), aoc:solve_all().
It's possible to automatically fetch the input file for each day.
To do this you will need to store a cookie for your logged-in session.
Grab the cookie from an authenticated session in your browser and
store the contents of the cookie's value in priv/.aoc-session.cookie
.