https://github.com/beeb/aoc-2025
My solutions for Advent of Code 2025
https://github.com/beeb/aoc-2025
Last synced: about 1 month ago
JSON representation
My solutions for Advent of Code 2025
- Host: GitHub
- URL: https://github.com/beeb/aoc-2025
- Owner: beeb
- Created: 2025-11-30T13:19:38.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-12-11T07:47:28.000Z (6 months ago)
- Last Synced: 2025-12-12T00:48:57.800Z (6 months ago)
- Language: Rust
- Homepage: https://adventofcode.com/
- Size: 89.8 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Advent of Code Rust template
This is a basic template you can fork and implement your Advent of Code solutions in. `src/days/` contains a source file
for all 12 days, where an implementation of a trait `Day` should be written. If using this template for an older
challenge, you'll need to add the missing day modules for days 13-25 and modify the `match` in `run_day`.
```rust
pub trait Day {
type Input;
fn parser(input_string: &mut &str) -> Result;
type Output1: Display;
fn part_1(input: &Self::Input) -> Self::Output1;
type Output2: Display;
fn part_2(input: &Self::Input) -> Self::Output2;
}
```
The parsers should be written using [winnow](https://docs.rs/winnow/latest/winnow/).
## Dev shell
A `flake.nix` provides a [nix](https://nixos.org/) dev shell with the rust toolchain installed.
Enter the shell by running `nix develop --impure` (requires the `nix-command` and `flakes`
[experimental features](https://nixos.wiki/wiki/Flakes))
## Usage
First, modify the package metadata in `Cargo.toml` and change the current `YEAR` constant in `src/main.rs`.
Then, find your session cookie. To do so, go to [https://adventofcode.com](adventofcode.com), log in, and press F12. In
the "Application" tab, under "Storage > Cookies > https://adventofcode.com", copy the value of the "session" cookie.
Paste it into a file named `.session` at the root of the project. You can now download input files. To do so, run the
subcommand `get`: `cargo run -- get 1`. The `1` stands for day 1, meaning it will download the input of day
1 of Advent of Code. Alternatively, from December 1st to 12th, you can skip the day parameter, and the program will
download today's input. You can also use `--all` instead of a day parameter to download all input files.
To run your implementation, use `cargo run [-r] -- run 1` (`-r` for release profile) to run day 1. Just like
`get`,you can skip the day parameter to run today's program, or use `--all` to run all days.