My Advent of Code things for 2024!
- Register with Advent of Code
- Using Dev-Tools, find your session cookie (cookie-store or in network requests. Your token should have the form of a 128 charater long alphanumeric string | Note: since it's HttpOnly, it can't be accessed via
Document.cookie) - Save the string in
.cookie
- It is fairly simple to manually populate
./aoccache/. The structure of currently required information in this directory is:- year/ (e.g., 2024, 15 (this is != 2015), 8798432 (please don't try anything BCE))
- dd/ (e.g., 01, 08, 24)
- input (basically a
.txtfile without an extension; UTF-8)
- input (basically a
- dd/ (e.g., 01, 08, 24)
- year/ (e.g., 2024, 15 (this is != 2015), 8798432 (please don't try anything BCE))
- The code for individual days is also quite modular. In
cady_does_aoc/src/days/, every day has a filedxx.rs, with public solver functionssolver_[a/b](input: &str) -> AocResultfor each part (provided they are finished). They produce the solutionStringin the result'sOkvariant.
This is exported to main via thedaysmodule in the form of the individual submodules (e.g.,d01,d08,d24).
In addition to the public solvers, each submodule also exportsPROBLEM(a staticProblemstruct), whose associatedsolve_standalone(&str)function runs both solvers, printing the results to stdout / errors to stderr.
We try our best to adhere to the automation guidelines outlined in r/adventofcode/wiki/faqs/automation. Specifically:
- Inputs are cached, we don't submit anything (at the moment)
- // TODO: Outbound calls are throttled to every x minutes in []
Once inputs are downloaded, they are cached locally (aoc_plumbing/src/aocapi/request.rs,cached_request()) - The User-Agent header for all requests to AoC contains the maintainers e-mail address, as well as the URL of this repository (
aoc_plumbing/src/aocapi/mod.rs,APP_USER_AGENT)