Skip to content

About

Solutions for Advent Of Code

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

 

History

25 Commits

Folders and files

Repository files navigation

Advent of Code Solutions

Solutions for Advent of Code written in Odin. For TypeScript solutions for the years 2015-2025, check the typescript branch.

Setup

Requirements:

  • Odin
  • go-task (installed as task or go-task, depending on the system)
  • curl to 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.

Commands

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 test

Inputs

My 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].

About

Solutions for Advent Of Code

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages