Skip to content

Advent Of Code solutions. [In the process of merging solutions of different years]

Notifications You must be signed in to change notification settings

rossop/AdventOfCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code Solutions

Year Days Badge Stars Badge
2019 2019 Days 2019 Stars
2020 2020 Days 2020 Stars
2021 2021 Days 2021 Stars
2022 2022 Days 2022 Stars
2023 2023 Days 2023 Stars

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.

Structure

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

Quickstart

Installation

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]'

Configuration

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.

Using 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

Running Solutions

Each day's solution can be executed individually. For example, to run the solution for Day 1:

python solutions/day01.py

Automated Submission

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)

Feedback

If you have feedback, suggestions or improvements, feel free to open an issue or submit a pull request.

About

Advent Of Code solutions. [In the process of merging solutions of different years]

Resources

Stars

Watchers

Forks

Languages