Skip to content

holubowicz/aocdotex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code Elixir Helper

Your trusty companion for Advent of Code in Elixir! 🌟

This helper streamlines your Advent of Code workflow, letting you focus on the fun part – solving puzzles!

Features

  • Day Generation: Scaffold new day files with mix aoc.gen.day.
  • Input Fetching: Automatically download your puzzle input with mix aoc.fetch.
  • Solution Runner: Run your solutions with mix aoc.run.
  • Solution Tester: Test your solutions with mix aoc.test.

Setup

  1. Clone the repo:

    git clone git@github.com:holubowicz/aocdotex.git && cd aocdotex
  2. Install dependencies:

    mix deps.get
  3. Set your session cookie: To fetch your puzzle inputs, you'll need to set your Advent of Code session cookie as an environment variable.

    export AOC_SESSION="your_session_cookie_here"

    You can find this in your browser's developer tools while logged into the Advent of Code website.

    For convenience, you can add this to a setup.fish or setup.sh file (examples provided) and source it.

    cp setup.sh.example setup.sh
    # Edit setup.sh to add your session cookie
    source ./setup.sh

Usage

Generate a New Day

This command creates the solution file, test file, and an empty input file for the given day.

mix aoc.gen.day <year> <day>

Example:

mix aoc.gen.day 2025 1

If your AOC_SESSION is set, it will even fetch the input for you!

Fetch Puzzle Input

If you've already generated the files, you can fetch the input separately.

mix aoc.fetch <year> <day>

Example:

mix aoc.fetch 2025 1

Run Your Solution

Execute your solution for a specific day and part.

mix aoc.run <year> <day> [part]
  • part can be one or two.
  • If part is omitted, it will run both parts.

Example:

mix aoc.run 2025 1
mix aoc.run 2025 1 one
mix aoc.run 2025 1 two

Test Your Solution

Run the tests for a specific day's solution.

mix aoc.test <year> <day>

Example:

mix aoc.test 2025 1

About

Advent of Code - Elixir Helper

Resources

License

Stars

Watchers

Forks