Implement day 05.

This was a nice exercise in not allocating memory. Or at least it was,
for part 1.
This commit is contained in:
2018-12-05 10:39:39 +01:00
parent 3d68f20097
commit 3543351c20
4 changed files with 91 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ pub mod day01;
pub mod day02;
pub mod day03;
pub mod day04;
pub mod day05;
fn get_impl(day: &str) -> Box<common::Solution> {
match day.parse() {
@@ -18,6 +19,7 @@ fn get_impl(day: &str) -> Box<common::Solution> {
Ok(2) => Box::new(day02::Day02::new()),
Ok(3) => Box::new(day03::Day03::new()),
Ok(4) => Box::new(day04::Day04::new()),
Ok(5) => Box::new(day05::Day05::new()),
Ok(val) => panic!("Unimplemented day {}", val),
_ => panic!("Invalid number"),
}
@@ -63,7 +65,7 @@ mod tests {
#[test]
fn test_get_impl() {
// Verify that we can load all days
let last_implemented = 4;
let last_implemented = 5;
for d in 1..=last_implemented {
get_impl(&format!("{}", d));
}