This repository contains Advent of Code solutions in Python, Rust, and occasionally C++. Below you will find instructions on how to set up your environment and run the solutions.
- Python 3.10+: Download Here
- PyPy (Optional, for speed): Download Here
Navigate to the specific day's directory and run:
# Standard Python
python solution.py
# Using PyPy
pypy solution.pyStarting from 2025, the project uses a Cargo Workspace structure.
- Rust Toolchain: Install Here
- Navigate to the 2025 directory:
cd 2025 - Create a new day (bootstraps files):
python3 new_day.py <day_number> # Example: python3 new_day.py 5
You can run solutions directly from the 2025 root using the package name (dayXX).
# Debug Mode (slower, better error checks)
cargo run -p day01
# Release Mode (fast!)
cargo run --release -p day01
# Benchmarking
cargo bench -p day01For older years (e.g., 2022), navigate to the year folder and run:
cd 2022
cargo run --release --bin day01Used mainly in 2018.
- Navigate to the year folder:
cd 2018 - Generate build files:
mkdir build && cd build && cmake ..
- Compile:
make day01 && cmake --install day01 - Run:
cd install/day01 && ./day01
This template uses advent-of-code-data to automatically fetch your puzzle inputs.
-
Install the tool:
pip install advent-of-code-data
-
Authentication:
- Log in to Advent of Code in your browser.
- Find your
sessioncookie (F12 -> Application -> Cookies). - Create a
.envfile in the2025directory (or root). - Add:
AOC_SESSION=your_copied_cookie_value
-
Usage: When you run
python3 new_day.py, it will automatically downloadinput.txt.