Elixir implementation of the Advent of Code 2021 challenges
mix deps.get
Make a new file config/secrets.exs
and define it like so:
use Mix.Config
config :advent_of_code, AdventOfCode.Input,
session_cookie: "..." # yours will be longer
Replace the session_cookie
value with your cookie from the adventofcode website
There are three different ways of gathering input:
- Downloading input directly from the advent of code website
- Using a cache from your saved download
- Using dev_input directory (aka my input)
The input loading order depends on configuration and existence of files.
- If
allow_dev_dir?
in config/config.exs is set totrue
and the input file exists for your specified year/day/part insidedev_input
directory, the program will prioritize this first. - If the input file exists for your specified year/day/part inside
.cache
directory, the program will prioritize this second. - If
allow_network?
in config/config.exs is set totrue
, it will download the input directly from the Advent of Code website- Note: You must have your secret setup correctly. Refer to Secrets Config.
mix day_runner -d X -p Y -y Z
Replace X
with your day, Y
with part (either 1
or 2
), and Z
with your year
e.g. to run day 01, part 01, year 2022
mix day_runner -d 1 -p 1 -y 2022