Skip to content

πŸŽ„ My solutions to the Advent of Code 2019. Written in Rust.

License

Notifications You must be signed in to change notification settings

smudger/aoc2019-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ„ Advent of Code 2019 - Rust

My solutions to the Advent of Code 2019. 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/aoc2019-rust/actions/workflows/benchmark.yml
Part 1 Part 2

Day 01

2200 ns

3600 ns

❀️ 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.