diff --git a/src/input/day04 b/src/input/day04 new file mode 100644 index 0000000..e69de29 diff --git a/src/input/day04_test1 b/src/input/day04_test1 new file mode 100644 index 0000000..e69de29 diff --git a/src/input/day04_test2 b/src/input/day04_test2 new file mode 100644 index 0000000..e69de29 diff --git a/src/main.rs b/src/main.rs index 3430f91..80d5ac6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,6 +10,7 @@ fn main() -> Result<(), Box> { Box::new(day01::Day01 {}), Box::new(day02::Day02 {}), Box::new(day03::Day03 {}), + Box::new(day04::Day04 {}), ]; // Run through and generate solutions diff --git a/src/solutions/day01.rs b/src/solutions/day01.rs index 0158ead..1a045ff 100644 --- a/src/solutions/day01.rs +++ b/src/solutions/day01.rs @@ -109,7 +109,7 @@ mod test { //Complete the Challenge let answer = challenge .part1( - get_input(challenge.get_day(), utils::InputType::Test1) + utils::get_input(challenge.get_day(), utils::InputType::Test1) .unwrap() .as_mut(), ) @@ -126,7 +126,7 @@ mod test { //Complete the Challenge let answer = challenge .part2( - get_input(challenge.get_day(), utils::InputType::Test2) + utils::get_input(challenge.get_day(), utils::InputType::Test2) .unwrap() .as_mut(), ) diff --git a/src/solutions/day02.rs b/src/solutions/day02.rs index 3036f0b..ff5af89 100644 --- a/src/solutions/day02.rs +++ b/src/solutions/day02.rs @@ -115,7 +115,7 @@ mod test { //Complete the Challenge let answer = challenge .part1( - get_input(challenge.get_day(), utils::InputType::Test1) + utils::get_input(challenge.get_day(), utils::InputType::Test1) .unwrap() .as_mut(), ) @@ -132,7 +132,7 @@ mod test { //Complete the Challenge let answer = challenge .part2( - get_input(challenge.get_day(), utils::InputType::Test2) + utils::get_input(challenge.get_day(), utils::InputType::Test2) .unwrap() .as_mut(), ) diff --git a/src/solutions/day03.rs b/src/solutions/day03.rs index f32b8d8..eade51a 100644 --- a/src/solutions/day03.rs +++ b/src/solutions/day03.rs @@ -5,14 +5,14 @@ pub struct Day03 {} impl Solution for Day03 { fn part1( &self, - input: &mut Vec, + _input: &mut Vec, ) -> Result, Box> { Ok(Box::new("Ready")) } fn part2( &self, - input: &mut Vec, + _input: &mut Vec, ) -> Result, Box> { Ok(Box::new("Ready")) } @@ -37,7 +37,7 @@ mod test { //Complete the Challenge let answer = challenge .part1( - get_input(challenge.get_day(), utils::InputType::Test1) + utils::get_input(challenge.get_day(), utils::InputType::Test1) .unwrap() .as_mut(), ) @@ -54,7 +54,7 @@ mod test { //Complete the Challenge let answer = challenge .part2( - get_input(challenge.get_day(), utils::InputType::Test2) + utils::get_input(challenge.get_day(), utils::InputType::Test2) .unwrap() .as_mut(), ) diff --git a/src/solutions/day04.rs b/src/solutions/day04.rs new file mode 100644 index 0000000..9c3adcc --- /dev/null +++ b/src/solutions/day04.rs @@ -0,0 +1,66 @@ +use super::Solution; + +pub struct Day04 {} + +impl Solution for Day04 { + fn part1( + &self, + _input: &mut Vec, + ) -> Result, Box> { + Ok(Box::new("Ready")) + } + + fn part2( + &self, + _input: &mut Vec, + ) -> Result, Box> { + Ok(Box::new("Ready")) + } + + fn get_day(&self) -> u8 { + 4 + } +} + +impl Day04 {} + +/// Test from puzzle input +#[cfg(test)] +mod test { + use super::*; + use crate::*; + + #[test] + fn part1() { + let challenge = day04::Day04 {}; + + //Complete the Challenge + let answer = challenge + .part1( + utils::get_input(challenge.get_day(), utils::InputType::Test1) + .unwrap() + .as_mut(), + ) + .unwrap() + .to_string(); + + assert_eq!(answer, "Ready"); + } + + #[test] + fn part2() { + let challenge = day04::Day04 {}; + + //Complete the Challenge + let answer = challenge + .part2( + utils::get_input(challenge.get_day(), utils::InputType::Test2) + .unwrap() + .as_mut(), + ) + .unwrap() + .to_string(); + + assert_eq!(answer, "Ready"); + } +} diff --git a/src/solutions/mod.rs b/src/solutions/mod.rs index 15234f7..dd1517f 100644 --- a/src/solutions/mod.rs +++ b/src/solutions/mod.rs @@ -1,6 +1,7 @@ pub mod day01; pub mod day02; pub mod day03; +pub mod day04; use crate::utils::{self, get_input}; use std::{error::Error, fmt::Display, time::SystemTime};