My solutions to Advent of Code 2019, which I'm doing in Rust.
Happy December 2019! I'm tackling Advent of Code 2019 in Rust, as usual.
I used Rust for the 2018 AoC and the 2017 AoC, too, but I've never gotten far. My goal is to beat my record of 16 stars (out of a possible 50), which I managed back in 2017.
The code for each day's challenge (1 through, hopefully-but-probably-not-all-the-way-to, 25) is in a Rust executable in src/bin
. Thus the code for, say, Day 2's executable is located in src/bin/day02.rs
. To run the Day 2 executable, from the root directory run cargo run --bin day02
. To run tests, if there are any, run cargo test --bin day02
.
The input for each challenge is located in inputs
and named by the day (so for example, inputs/day02.txt
).
A lot of the Advent of Code puzzles require similar file-reading and parsing tasks. I put some of the more useful functions I've used over the years in src/lib.rs
, including some basic tests. Feel free to submit pull requests or issues related to them, or copy them over to your AoC project!