Add a way to select each day.

This commit is contained in:
Drew Galbraith 2023-12-02 11:34:01 -08:00
parent c5e0ac820a
commit 79531921f3
1 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,4 @@
use std::env;
use std::io;
fn get_calibration_digits() -> u32 {
@ -98,5 +99,14 @@ fn get_calibration_digits_alnum() -> u32 {
}
fn main() {
println!("Sum: {}", get_calibration_digits_alnum());
let args: Vec<String> = env::args().collect();
if args.len() < 2 {
println!("Select a day (i.e. day1a, day1b)");
return;
}
match args[1].as_str() {
"day1a" => println!("Sum: {}", get_calibration_digits()),
"day1b" => println!("Sum: {}", get_calibration_digits_alnum()),
_ => println!("Unrecognized day: {}", args[1]),
}
}