Advent of Code 2018 (Rust)
Switch branches/tags
Nothing to show
Clone or download
Latest commit 7466c08 Dec 14, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
benches Day 9. Dec 9, 2018
input Day 14. Dec 14, 2018
src Day 14. Dec 14, 2018
.gitignore Prepare for 2018. Nov 30, 2018
Cargo.toml Update advtools. Dec 10, 2018
Makefile Prepare for 2018. Nov 30, 2018
README.md More readme. Dec 9, 2018

README.md

🎄 Advent of Code 2018 🎄

These are Rust-language solutions for the coding-challenge advent calendar. You'll need stable Rust 1.31 and Cargo to run.

I've tried to make the solutions small and somewhat optimized for speed (so far, no solution takes more than about a second on an up-to-date machine). Inputs are included in text file form and parsed.

External code used

A custom helper library is used, called advtools. It provides utilities for easily parsing the input files, which I don't want to rewrite each year, and access to often used external crates like itertools and rayon.

For tasks that require nontrivial datastructures or algorithms, I try to find and use a third-party crate to show off the ease of using Rust's crates infrastructures, e.g. petgraph.

Building/benchmarking

All code is contained in a single Cargo project, with a different binary target for each day. Solutions are printed to stdout.

A simple Makefile is also provided in order to run all days. Just run make.

Benchmarks are now provided by criterion.rs, use

cargo bench --bench days [filter]

to run them.