Crates.io | aoc-runner |
lib.rs | aoc-runner |
version | 0.3.0 |
source | src |
created_at | 2018-11-30 00:16:28.925926 |
updated_at | 2019-12-09 16:51:40.301507 |
description | A runner for the Advent of Code |
homepage | |
repository | https://github.com/gobanos/aoc-runner |
max_upload_size | |
id | 99296 |
size | 3,382 |
This is a simple project that aims to be a runner for the Advent of Code.
Implement your solution. Let us do the rest.
cargo new advent-of-code-2018 --lib
aoc-runner = "0.1.0"
aoc-runner-derive = "0.1.0"
extern crate aoc_runner;
#[macro_use]
extern crate aoc_runner_derive;
aoc_lib!{ year = 2018 }
at the end of your lib.rsjust 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.
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 {
...
}
See cargo-aoc