AoC Python Language Template

🎄 Advent of Code 2022 Python 🎄

Solutions

Day Day Day Day Day Day Day Day Day Day Day Day Day Day Day Day Day Day Day Day Day Day Day Day Day

Click a badge to go to the specific day.


Installation

All project dependencies are covered in the Dockerfile definition in the repository root.

Local

This assumes Docker as a runtime (feel free to use other runtimes). First ensure that Docker is installed. From the repository root, build an image and tag appropriately (e.g., aoc-py:local):

docker build --tag aoc-py:local --file Dockerfile .

Once logged in on Advent of Code, locate your session key; this shows up as the value for the cookie key in your request headers that you can pull out from browser network tab. Write this value to a .env file in the repository root under AOC_SESSION variable:

AOC_SESSION=<insert session key here>

From the repository root, instantiate a container with the current directory mounted and environment variables exported:

docker run --rm -it \
  --env-file .env \
  --volume $PWD:/aoc-py/$(basename $PWD) \
  --workdir /aoc-py/$(basename $PWD) \
  aoc-py:local /bin/bash

GitHub Codespaces

Once logged in on Advent of Code, locate your session key; this shows up as the value for the cookie key in your request headers that you can pull out from browser network tab. Manage this value as an encrypted secret for your codespaces and name it AOC_SESSION.

Create a Codespace from your repository fork.

Develop with aocrunner

After getting setup, whether it's locally or on GitHub Codespaces, create a new subdirectory under src for the day of the challenge.

cp -vr src/template src/day<day>

Example:

cp -vr src/template src/day01

Add a README.md and use the aocd runner to write input files as needed. Execute solutions as a library module:

python -m src.day01.main

Results

Day 01
Time part 1: -
Time part 2: -
Both parts: -
Day 02
Time part 1: -
Time part 2: -
Both parts: -
Day 03
Time part 1: -
Time part 2: -
Both parts: -
Day 04
Time part 1: -
Time part 2: -
Both parts: -
Day 05
Time part 1: -
Time part 2: -
Both parts: -
Day 06
Time part 1: -
Time part 2: -
Both parts: -
Day 07
Time part 1: -
Time part 2: -
Both parts: -
Day 08
Time part 1: -
Time part 2: -
Both parts: -
Day 09
Time part 1: -
Time part 2: -
Both parts: -
Day 10
Time part 1: -
Time part 2: -
Both parts: -
Day 11
Time part 1: -
Time part 2: -
Both parts: -
Day 12
Time part 1: -
Time part 2: -
Both parts: -
Day 13
Time part 1: -
Time part 2: -
Both parts: -
Day 14
Time part 1: -
Time part 2: -
Both parts: -
Day 15
Time part 1: -
Time part 2: -
Both parts: -
Day 16
Time part 1: -
Time part 2: -
Both parts: -
Day 17
Time part 1: -
Time part 2: -
Both parts: -
Day 18
Time part 1: -
Time part 2: -
Both parts: -
Day 19
Time part 1: -
Time part 2: -
Both parts: -
Day 20
Time part 1: -
Time part 2: -
Both parts: -
Day 21
Time part 1: -
Time part 2: -
Both parts: -
Day 22
Time part 1: -
Time part 2: -
Both parts: -
Day 23
Time part 1: -
Time part 2: -
Both parts: -
Day 24
Time part 1: -
Time part 2: -
Both parts: -
Day 25
Time part 1: -
Time part 2: -
Both parts: -
Total stars: 0/50
Total time: 0ms

🎄🎁🎄🎅🎄🎁🎄