anowell

anowell / RustyAoC2018 / 0.3.0

README.md

Overview

Advent of Code 2018 solutions in Rust that are live on the Algorithmia API.

Usage

Input

ParameterDescription
dayDay number of the Advent of Code puzzle
part1 or 2. Each AoC puzzle has 2 parts
inputA string containing the entire puzzle input

Output

Outputs a JSON serialization of the solutions output, generally a number or a string.

Examples

Running the 2018 Day 1 puzzle:

{
  "day": 1,
  "part": 2,
  "input": "+7, +7, -2, -7, -4"
}

Running Locally

Build it tested on both 1.22.1 and nightly rust, though you will need nightly to run benchmarks.

cargo build
cargo test
cargo test day4

Benchmarks and the aoc binary it use inputs from inputs/day-{num}.txt.

# Run all the benchmarks
cargo bench

# Run benchmarks for a specific day
cargo bench day4

# TODO
cargo build --release
target/release/aoc 4-1
target/release/aoc 4-1 inputs/day-4.txt