Year | Days Badge | Stars Badge |
---|---|---|
2019 | ||
2020 | ||
2021 | ||
2022 | ||
2023 |
This repository contains my solutions for the Advent of Code (AoC) challenges, specifically for the year 2024. The structure is designed to organize inputs, solutions, and tests efficiently, facilitating quick access and understanding of each day's challenge.
The repository is organized as follows:
AdventOfCode/
├── 2024/
│ ├── in/
│ │ ├── 1.in # Actual input for Day 1
│ │ ├── 1pt1.test # Test input for Day 1, Part 1
│ │ ├── 1pt2.test # Test input for Day 1, Part 2
│ ...
│ ├── solutions/
│ ├── 1.py # Solution script for Day 1
│ ...
│
├── env/ # Requirements for different venvs
├── templates/
├── utils/
│ ├── fetch.py # Fetch data from aoc (using aocd)
│
├── README.md
├── .gitignore
Ensure you have Python installed on your system. This project uses the advent-of-code-data
package to fetch puzzle data, making data retrieval straightforward and efficient.
To install the required package, run:
pip install advent-of-code-data
For Jupyter notebook users:
pip install 'advent-of-code-data[nb]'
Puzzle inputs are unique to each user and require your AoC session token for access. To set up your environment:
export AOC_SESSION=your_session_token_here
Windows users should use set
instead of export
.
advent-of-code-data
Fetch today's puzzle data:
from aocd import data
Or, fetch data for a specific day and year:
from aocd import get_data
day_data = get_data(day=1, year=2024)
To save data directly to a file:
aocd > in/day01.in
Each day's solution can be executed individually. For example, to run the solution for Day 1:
python solutions/day01.py
The advent-of-code-data
package supports automated submission of your solutions:
from aocd import submit
submit(my_answer, part='a', day=1, year=2024)
If you have feedback, suggestions or improvements, feel free to open an issue or submit a pull request.