This repository contains my AoC 2024 solutions. Don't know what Advent of Code is? Read more on their website.
If you want to use the dev container that comes with this repository (so you don't have to install a Rust toolchain etc. manually), you need to have Docker and the Visual Studio Code extension Dev Containers installed. Using the dev container is optional if you have your own Rust toolchain.
If you want to run my solutions, or use the repository as a template for your own solutions, follow these steps:
- Clone this repository
- If you want to use the dev container, open the repository folder in Visual Studio Code. When prompted (there should be a popup in the bottom right corner), select "Reopen in Container". If the prompt doesn't appear, click the blue dev container icon in the bottom left corner and select "Reopen in Container" from there.
- If you want to automatically fetch your inputs from the AoC website, find your session token as described here and put it in a file called .token in the repository root.
If you're using this repository as a template and I've already put solutions in the days, feel free to just delete them all and use the python script in util
to generate blank day files:
cd util
python3 generate_days.py
To run your solution for the current day's problem, simply call cargo run
. This will fetch today's input if there isn't a day<day>.txt
file in inputs
, and then run the current day.
Subcommands are available for running specific days (cargo run -- run <day>
- this also fetches the input if it's not present) and for fetching inputs from the AoC website (cargo run -- fetch <day>
).
You can always get a description of the subcommands by running cargo run -- help
, or a description of their arguments by running cargo run -- help <subcommand>
.
For computationally intensive solutions you may wish to call cargo run with the --release
flag (rather than in the default debug mode) to speed up runtime: cargo run --release [-- run <day>]