Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/smudger/aoc2019-rust

πŸŽ„ My solutions to the Advent of Code 2019. Written in Rust.
https://github.com/smudger/aoc2019-rust

advent-of-code advent-of-code-2019 advent-of-code-2019-rust aoc aoc-2019 aoc-2019-rust aoc-rust aoc2019 rust rust-lang rustlang

Last synced: 12 days ago
JSON representation

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

Awesome Lists containing this project

README

        

:repo: https://github.com/smudger/aoc2019-rust/blob/main
:aoc: https://adventofcode.com/2019/day

== :christmas_tree: Advent of Code 2019 - Rust

My solutions to the https://adventofcode.com/2019[Advent of Code 2019]. Written in https://www.rust-lang.org[Rust].

=== :running_woman: 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.

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

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

=== :trophy: Benchmarking

The {repo}/runner[`runner`] directory contains a binary {repo}/runner/src/bin/bench.rs[`bench.rs`] to benchmark the execution times for each of the solutions.

[source,bash]
----
# Benchmark the solutions for each day
cd runner
cargo run --release --bin bench
----

The {repo}/runner/src/bin/bench-ci.rs[`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.

image::https://github.com/smudger/aoc2019-rust/actions/workflows/benchmark.yml/badge.svg["https://github.com/smudger/aoc2019-rust/actions/workflows/benchmark.yml"]

[format="csv"]
[options="header"cols=",m,m"]
|===========================
,Part 1,Part 2
{aoc}/1[Day 01],{repo}/day01/src/lib.rs[2200 ns],{repo}/day01/src/lib.rs[3600 ns]

|===========================

=== :heart: Inspiration

The project structure is inspired by the Rust Advent of Code repos by https://github.com/timvisee/advent-of-code-2022[Tim VisΓ©e] and https://github.com/ChristopherBiscardi/advent-of-code[Chris Biscardi].

The benchmarking implementation is inspired by https://github.com/timvisee/advent-of-code-2022[Tim VisΓ©e].

=== :bookmark: License

This project is released under the GNU GPL-3.0 license. Check out the {repo}/LICENSE[LICENSE] file for more information.