Input files should be placed in root of the project with the format:
- day_#_example1
- day_#_example2
- day_#_part1
- day_#_part2
All utils functions is located in the aoc.rs
Run benchmark by cargo bench
. Benchmark report is located in target/criterion
Put days in ./days/ folder. Use this template:
use crate::days::aoc::Solution;
use super::aoc::Answer;
pub struct <ReplaceMe> {}
impl <ReplaceMe> {
pub fn new() -> Self {
Self {}
}
}
impl Solution for <ReplaceMe> {
fn solve_example1(&self) -> Answer {
let instant = self.timer_start();
return Answer::new("answer example1", instant.elapsed());
}
fn solve_part1(&self) -> Answer {
let instant = self.timer_start();
return Answer::new("answer part1", instant.elapsed());
}
fn solve_example2(&self) -> Answer {
let instant = self.timer_start();
return Answer::new("answer example2", instant.elapsed());
}
fn solve_part2(&self) -> Answer {
let instant = self.timer_start();
return Answer::new("answer part2", instant.elapsed());
}
fn get_day(&self) -> i32 {
return <DAY_NUMBER>
}
}
#[cfg(test)]
mod tests {
use super::*;
}