🎉 Initialized repository based on 2023 code

This commit is contained in:
LeMoonStar 2024-11-30 13:39:19 +01:00
commit cc42c33b5d
65 changed files with 3897 additions and 0 deletions

32
src/days/d17.rs Normal file
View file

@ -0,0 +1,32 @@
use super::{Answer, Day, DayImpl};
const CURRENT_DAY: u8 = 17;
type Data = Vec<u64>;
impl DayImpl<Data> for Day<CURRENT_DAY> {
fn init_test() -> (Self, Data) {
Self::init(include_str!("test_inputs/test17.txt"))
}
fn expected_results() -> (Answer, Answer) {
(Answer::Number(0), Answer::Number(0))
}
fn init(input: &str) -> (Self, Data) {
(
Self {},
input
.lines()
.map(|v| v.parse::<u64>().expect("error while parsing input."))
.collect(),
)
}
fn one(&self, data: &mut Data) -> Answer {
Answer::Number(data.len() as u64)
}
fn two(&self, data: &mut Data) -> Answer {
Answer::Number(data.len() as u64)
}
}