2022-11-27 02:39:02 +00:00
|
|
|
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-11-27 02:39:02 +00:00
|
|
|
|
|
|
|
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-11-27 02:39:02 +00:00
|
|
|
_ => panic!("unrecognized day"),
|
|
|
|
};
|
|
|
|
|
2022-12-01 14:46:04 +00:00
|
|
|
println!("[{}] {}", day.unwrap(), result);
|
2022-11-27 02:39:02 +00:00
|
|
|
}
|