6 releases

Uses old Rust 2015

0.3.0 Dec 9, 2019
0.2.2 Dec 13, 2018
0.1.0 Nov 30, 2018

#139 in Profiling

Download history 762/week @ 2023-12-06 697/week @ 2023-12-13 516/week @ 2023-12-20 216/week @ 2023-12-27 242/week @ 2024-01-03 419/week @ 2024-01-10 377/week @ 2024-01-17 313/week @ 2024-01-24 173/week @ 2024-01-31 441/week @ 2024-02-07 481/week @ 2024-02-14 464/week @ 2024-02-21 494/week @ 2024-02-28 495/week @ 2024-03-06 414/week @ 2024-03-13 480/week @ 2024-03-20

1,981 downloads per month

MIT/Apache

4KB

Advent of Code Runner

This is a simple project that aims to be a runner for the Advent of Code.

Implement your solution. Let us do the rest.

Features

  • Input downloading
  • Running your solution
  • Benchmarking of your solution (WIP)

Getting started

  • Create a lib project cargo new advent-of-code-2018 --lib
  • Add deps to your Cargo.toml:
aoc-runner = "0.1.0"
aoc-runner-derive = "0.1.0"
  • Include libs in your lib.rs
extern crate aoc_runner;

#[macro_use]
extern crate aoc_runner_derive;
  • Add aoc_lib!{ year = 2018 } at the end of your lib.rs
  • Start coding !

Flags your solutions

just add a #[aoc(day1, part1)] before your function !

#[aoc(day1, part1)]
fn part1(input: &str) -> i32 {
    ...
}

Supported signatures : &str or &[u8] as input, any type implementing display as output. For custom input, see below.

Custom Generators

You need to pre-process input in a separated function ? generators are for you !

#[aoc_generator(day2)]
fn input_generator(input: &str) -> Vec<Gift> {
    ...
}

#[aoc(day2, part1)]
fn part1(input: &[Gift]) -> u32 {
    ...
}

Run your code

See cargo-aoc

No runtime deps