advent-of-code/2022/src/main.rs

36 lines
901 B
Rust
Raw Normal View History

mod day1;
2022-12-02 14:10:12 +00:00
mod day2;
2022-12-04 03:16:57 +00:00
mod day3;
2022-12-05 04:36:21 +00:00
mod day4;
2022-12-11 05:37:55 +00:00
mod day5;
2022-12-12 03:27:32 +00:00
mod day6;
2022-12-12 06:16:32 +00:00
mod day7;
2023-12-01 15:05:47 +00:00
mod day8;
mod matrix;
fn main() {
let day = std::env::args().skip(1).next();
let result = match day.as_ref().map(|v| v.as_ref()) {
2022-12-01 14:46:04 +00:00
Some("1a") => day1::part1(),
Some("1b") => day1::part2(),
2022-12-02 14:10:12 +00:00
Some("2a") => day2::part1(),
Some("2b") => day2::part2(),
2022-12-04 03:16:57 +00:00
Some("3a") => day3::part1(),
Some("3b") => day3::part2(),
2022-12-05 04:36:21 +00:00
Some("4a") => day4::part1(),
Some("4b") => day4::part2(),
2022-12-11 05:37:55 +00:00
Some("5a") => day5::part1(),
Some("5b") => day5::part2(),
2022-12-12 03:27:32 +00:00
Some("6a") => day6::part1(),
Some("6b") => day6::part2(),
2022-12-12 06:16:32 +00:00
Some("7a") => day7::part1(),
Some("7b") => day7::part2(),
2023-12-01 15:05:47 +00:00
Some("8a") => day8::part1(),
Some("8b") => day8::part2(),
_ => panic!("unrecognized day"),
};
2022-12-01 14:46:04 +00:00
println!("[{}] {}", day.unwrap(), result);
}