mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-26 13:20:32 +01:00
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:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user