/aoc2022-rust

🎄 My solutions to the Advent of Code 2022. Written in Rust.

Primary LanguageRustGNU General Public License v3.0GPL-3.0

🎄 Advent of Code 2022 - Rust

My solutions to the Advent of Code 2022. Written in Rust.

🏃‍♀️ Running the solutions

Each Rust project contains one input.txt file and two project binaries part1.rs and part2.rs. The input.txt file contains the puzzle input for that day, and the binaries contain the solution to each part of the puzzle. Simply run the project with the desired binary to see the solution for that part of the problem appear.

The project may also contain a number of example inputs named sequentially starting from example01.txt. These inputs are used for the tests found in lib.rs and are not used to produce the actual solution.

# Switch to day 1, and run part 1
cd day01
cargo run --release --bin part1

# or run part 2
cargo run --release --bin part2

🏆 Benchmarking

The runner directory contains a binary bench.rs to benchmark the execution times for each of the solutions.

# Benchmark the solutions for each day
cd runner
cargo run --release --bin bench

The bench-ci.rs binary is used on the CI pipeline to benchmark the execution times more objectively, though still only provides a rough estimation. You can find the results below.

https://github.com/smudger/aoc2022-rust/actions/workflows/benchmark.yml
Part 1 Part 2

Day 01

0 ms

20 ms

❤️ Inspiration

The project structure is inspired by the Rust Advent of Code repos by Tim Visée and Chris Biscardi.

The benchmarking implementation is inspired by Tim Visée.

🔖 License

This project is released under the GNU GPL-3.0 license. Check out the LICENSE file for more information.