advent-of-code/src/year_2023/mod.rs

31 lines
1.1 KiB
Rust

use crate::utils::solution::Solution;
pub mod day_01_trebuchet;
pub mod day_02_cube_conundrum;
pub mod day_03_gear_ratios;
pub mod day_04_scratchcards;
pub mod day_06_wait_for_it;
pub mod day_08_haunted_wasteland;
pub mod day_09_mirage_maintenance;
pub mod day_10_pipe_maze;
pub mod day_11_cosmic_expantion;
pub fn run(day: &str) {
let solution: Box<dyn Solution> = match day {
"1" => Box::new(day_01_trebuchet::DaySolution),
"2" => Box::new(day_02_cube_conundrum::DaySolution),
"3" => Box::new(day_03_gear_ratios::DaySolution),
"4" => Box::new(day_04_scratchcards::DaySolution),
"6" => Box::new(day_06_wait_for_it::DaySolution),
"8" => Box::new(day_08_haunted_wasteland::DaySolution),
"9" => Box::new(day_09_mirage_maintenance::DaySolution),
"10" => Box::new(day_10_pipe_maze::DaySolution),
"11" => Box::new(day_11_cosmic_expantion::DaySolution),
_ => panic!("Invalid day specified"),
};
// Call part_one and part_two on the solution instance
println!("Part One Result: {}", solution.part_one());
println!("Part Two Result: {}", solution.part_two());
}