From bf1694bdae15563eaf97365c5605868bf5ee977e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20S=C5=82adek?= Date: Fri, 27 Dec 2024 14:49:35 +0100 Subject: [PATCH] chore(22/2024): add day boilerplate --- readme.md | 1 + src/solutions/mod.rs | 1 + src/solutions/year2024/day22.rs | 26 ++++++++++++++++++++++++++ src/solutions/year2024/mod.rs | 1 + 4 files changed, 29 insertions(+) create mode 100644 src/solutions/year2024/day22.rs diff --git a/readme.md b/readme.md index 344a409..d1d0319 100644 --- a/readme.md +++ b/readme.md @@ -32,6 +32,7 @@ | [Day 19: Linen Layout](src/solutions/year2024/day19.rs) | ⭐⭐ | 2.923 | 22.751 | | [Day 20: Race Condition](src/solutions/year2024/day20.rs) | ⭐⭐ | 7.355 | 280.627 | | [Day 21: Keypad Conundrum](src/solutions/year2024/day21.rs) | ⭐ | 0.454 | - | +| [Day 22: Monkey Market](src/solutions/year2024/day22.rs) | - | - | - | # 2023 diff --git a/src/solutions/mod.rs b/src/solutions/mod.rs index 7681fac..f3c59f6 100644 --- a/src/solutions/mod.rs +++ b/src/solutions/mod.rs @@ -34,6 +34,7 @@ pub fn solution(day: DayNumber, year: Year) -> Box { 19 => Box::new(year2024::day19::Day19), 20 => Box::new(year2024::day20::Day20), 21 => Box::new(year2024::day21::Day21), + 22 => Box::new(year2024::day22::Day22), _ => panic!("Day not exist"), }, Year::Year2023 => match i { diff --git a/src/solutions/year2024/day22.rs b/src/solutions/year2024/day22.rs new file mode 100644 index 0000000..ab8e937 --- /dev/null +++ b/src/solutions/year2024/day22.rs @@ -0,0 +1,26 @@ +use crate::solutions::Solution; + +pub struct Day22; + +impl Solution for Day22 { + fn part_one(&self, _input: &str) -> String { + String::from("0") + } + + fn part_two(&self, _input: &str) -> String { + String::from("0") + } +} + +#[cfg(test)] +mod tests { + use crate::solutions::year2024::day22::Day22; + use crate::solutions::Solution; + + const EXAMPLE: &str = r#""#; + + #[test] + fn part_one_example() { + assert_eq!("0", Day22.part_one(EXAMPLE)); + } +} diff --git a/src/solutions/year2024/mod.rs b/src/solutions/year2024/mod.rs index c01c1db..a6ae0ab 100644 --- a/src/solutions/year2024/mod.rs +++ b/src/solutions/year2024/mod.rs @@ -18,3 +18,4 @@ pub mod day18; pub mod day19; pub mod day20; pub mod day21; +pub mod day22;