Skip to content

rowillia/advent-of-code

Repository files navigation

🎄 Advent of Code

Usage

This works best inside of a VSCode Codespace.

  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. (Optional) Set the environment variable ANTHROPIC_API_KEY to your Anthropic API key, you can find one at https://console.anthropic.com . This will be used to automatically parse the problem's test data (NOT to answer the question).

  3. Generate the scaffolding for today's question

    python -m python.run scaffold
  4. If you didn't specify an ANTHROPIC_API_KEY, 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}/day{day}.py

"""
--- Day X: Problem Title ---
"""

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:

uv run pytest

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

uv run python -m python.run solve

About

Advent of Code - 2022

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published