Solutions and tests for Advent of Code puzzles.
Built from the template of Jon Zimbel's Elixir template.
Enable the automatic puzzle input downloader by creating a config/secrets.exs
file containing the following:
import Config
config :advent_of_code, AdventOfCode.Input,
allow_network?: true,
session_cookie: "..." # paste your AoC session cookie value here
Fetch dependencies with
mix deps.get
Generate a set of solution and test files for a new year of puzzles with
mix advent.gen -y${YEAR}
Now you can run the solutions with
mix advent.solve -d${DAY} -p${1 | 2} [-y${YEAR}] [--bench]
and tests with
mix test
either directly in your local terminal, or in VSCode's terminal pane while connected to the Docker container described below.
- Install Docker Desktop
- Open project directory in VS Code
- Press F1, and select
Remote-Containers: Reopen in Container...
- Wait a few minutes as it pulls image down and builds Dev Container Docker image (this should only need to happen once unless you modify the Dockerfile)
- You can see progress of the build by clicking
Starting Dev Container (show log): Building image
that appears in bottom right corner - During the build process it will also automatically run
mix deps.get
- You can see progress of the build by clicking
- Once complete VS Code will connect your running Dev Container and will feel like your doing local development
- If you would like to use a specific version of Elixir change the
VARIANT
version in.devcontainer/devcontainer.json
- If you would like more information about VS Code Dev Containers check out the dev container documentation
- If you don't have Github Codespaces beta access, sign up for the beta https://github.com/features/codespaces/signup
- On GitHub, navigate to the main page of the repository.
- Under the repository name, use the Code drop-down menu, and select Open with Codespaces.
- If you already have a codespace for the branch, click New codespace.