aoc2024/src/solutions/mod.rs

23 lines
610 B
Rust
Raw Normal View History

2024-12-06 00:55:56 +07:00
use std::path::Path;
use crate::utils::Result;
2024-12-03 18:05:54 +07:00
macro_rules! define_solution {
($($id:ident),+ $(,)?) => {
2024-12-06 00:55:56 +07:00
$(mod $id; pub use $id::*;)+
2024-12-03 18:05:54 +07:00
};
}
define_solution!(
day_1, day_2, day_3, day_4, day_5, day_6, day_7, day_8, day_9, day_10, day_11, day_12, day_13,
day_14, day_15, day_16, day_17, day_18, day_19, day_20, day_21, day_22, day_23, day_24, day_25,
);
2024-12-02 23:23:48 +07:00
pub trait AocSolution {
type Output;
2024-12-06 00:55:56 +07:00
fn get_input(&self, path: Option<&Path>) -> Result<String>;
fn part_one(&self, input: &str) -> Result<Self::Output>;
fn part_two(&self, input: &str) -> Result<Self::Output>;
2024-12-02 23:23:48 +07:00
}