Solutions for Advent of Code written in Odin. For TypeScript solutions for the years 2015-2025, check the typescript branch.
Requirements:
- Odin
- go-task (installed as
taskorgo-task, depending on the system) curlto fetch inputs- hyperfine for benchmarking (optional)
To fetch inputs, copy .env.dist to .env and set AOC_SESSION to the value of the session cookie from adventofcode.com.
Tip
YEAR and DAY default to today's date and can be overwritten for all commands.
# Scaffold a day from templates/day_template.odin and fetch its input
task new
task new YEAR=[year] DAY=[day]# Fetch the input of a day to inputs/[year]/[day].in
task get
task get YEAR=[year] DAY=[day]# Run a part of a day (part defaults to 1)
# Add --test after the part to use inputs/[year]/[day].in-test instead
task run -- [part]
task run -- [part] --test
task run YEAR=[year] DAY=[day] -- [part]# Benchmark a part of a day (requires hyperfine)
task bench:day -- [part]
task bench:day YEAR=[year] DAY=[day] -- [part]# Run the tests for the shared library in lib/
task testMy personal inputs are not shared in this repository.
Although it is not strictly forbidden, the creator asks that personal inputs are not shared or collected.
To refetch the input of an already created day, run task get YEAR=[year] DAY=[day].