template for day 9

master
mitchellhansen 4 years ago
parent c4a27e82e0
commit 9d41f04535

@ -10,6 +10,7 @@ use crate::problem5::lib::Problem5;
use crate::problem6::lib::Problem6;
use crate::problem7::lib::Problem7;
use crate::problem8::lib::Problem8;
use crate::problem9::lib::Problem9;
mod problem1;
mod problem2;
@ -19,6 +20,7 @@ mod problem5;
mod problem6;
mod problem7;
mod problem8;
mod problem9;
mod util;
@ -32,35 +34,7 @@ pub trait Problem {
}
fn main() {
// let problem1 = Problem1::new(&util::get_problem(1));
// problem1.run_part1();
// problem1.run_part2();
//let problem2 = Problem2::new(&util::get_problem(2));
//problem2.run_part1();
//problem2.run_part2();
// let problem3 = Problem3::new(&util::get_problem(3));
// problem3.run_part1();
// problem3.run_part2();
// let problem4 = Problem4::new(&util::get_problem(4));
// problem4.run_part1();
// problem4.run_part2();
// let problem5 = Problem5::new(&util::get_problem(5));
// problem5.run_part1();
// problem5.run_part2();
// let problem6 = Problem6::new(&util::get_problem(6));
// problem6.run_part1();
// problem6.run_part2();
/*let problem7 = Problem7::new(&util::get_problem(7));
problem7.run_part1();
problem7.run_part2();*/
let problem8 = Problem8::new(&util::get_problem(8));
problem8.run_part1();
problem8.run_part2();
let problem9 = Problem9::new(&util::get_problem(9));
problem9.run_part1();
problem9.run_part2();
}

@ -0,0 +1,34 @@
use crate::Problem;
pub struct Problem9 {
number_list: Vec<i32>,
}
impl Problem9 {}
impl Problem for Problem9 {
fn new(input: &String) -> Self {
Problem9 {
number_list: input
.split("\n")
.filter_map(|s| {
let s = s.trim();
if !s.is_empty() {
Some(s.parse::<i32>().unwrap())
} else {
None
}
}).collect(),
}
}
fn run_part1(&self) {
}
fn run_part2(&self) {
}
}

@ -0,0 +1 @@
pub mod lib;
Loading…
Cancel
Save