rowillia / advent-of-code-template

Template Python Repository for Advent of Code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🎄 Advent of Code 2022

Usage

  1. (Optional) Set the environment variable ADVENT_SESSION_COOKIE or add it to to your adventofcode session cookie to automatically download your problem input. This can be find in the "Application > Storage > Cookies" section of the Chrome Developer Tools while visiting https://adventofcode.com .

    Screenshot 2023-11-28 at 5 35 34 PM
  2. Generate the scaffolding for today's question

    poetry shell
    python -m python.run scaffold
  3. Paste the sample input and answer(s) into examples/{year}/{day}.yaml. For example:

    input: |-
    A Y
    B X
    C Z
    answers:
    - 15
    - 12

Scaffolding will generate an empty solution file with 2 methods - part1 and part2.

python/solutions/{year}/dayXY.py

def part1(text: str) -> int | None:
    return None


def part2(text: str) -> int | None:
    return None

Unit Tests will be automatically generated based on the examples specified in the above yaml. Simply run:

poetry run pytest

Once you are satisfied with today's answer, generate your answer with:

python -m python.run solve

About

Template Python Repository for Advent of Code

License:MIT License


Languages

Language:Python 95.4%Language:Dockerfile 4.6%