AdventOfCode.jl Documentation

Contents

Setup

AdventOfCode.jl exports one function, setup_files that lets you get up and running with Advent of Code problems by downloading data and setting up your file structure. To get started, you need an AdventOfCode cookie. Navigate to www.adventofcode.com, log in with whichever method you prefer and grab your cookie, using one of these methods depending on your browser.

Once you have your cookie, store it in ENV["AOC_SESSION"]. After that, you should be ready to use this package. Since the Advent of Code cookies are very long-lived, I suggest adding ENV["AOC_SESSION"] = {YOUR_COOKIE} to your ~/.julia/config/startup.jl file so that it's always available when you start Julia.

Documentation

AdventOfCode.setup_filesMethod
setup_files(year, day; force = false)
setup_files(; force = false)

Downloads the input file for the specified year and date and stores that file in data/{year}/day_{day}.txt. Also sets up a template file in src/{year}/day_{day}.jl for your script. force=true will recreate the src file even if it already exists. The data file will not be re-downloaded even with force=true since it's a static file and to reduce load on AdventOfCode's servers.

If year and day are not provided, the setup defaults to today's date.

source

Index