2021-12-29 14:36:48 +01:00
|
|
|
use aoc::{ANSI_BOLD, ANSI_RESET};
|
|
|
|
use std::process::Command;
|
2021-12-29 14:12:01 +01:00
|
|
|
|
|
|
|
fn main() {
|
2021-12-29 14:36:48 +01:00
|
|
|
(1..=25).for_each(|day| {
|
|
|
|
let day = format!("{:02}", day);
|
|
|
|
|
|
|
|
let cmd = Command::new("cargo")
|
|
|
|
.args(&["run", "--release", "--bin", &day])
|
|
|
|
.output()
|
|
|
|
.unwrap();
|
2021-12-29 14:12:01 +01:00
|
|
|
|
2021-12-29 14:36:48 +01:00
|
|
|
let output = String::from_utf8(cmd.stdout).unwrap();
|
|
|
|
println!("----------");
|
|
|
|
println!("{}| Day {} |{}", ANSI_BOLD, day, ANSI_RESET);
|
|
|
|
println!("----------");
|
|
|
|
println!(
|
|
|
|
"{}",
|
|
|
|
if !output.is_empty() {
|
|
|
|
output
|
|
|
|
} else {
|
|
|
|
"Not solved.".to_string()
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
2021-12-29 14:12:01 +01:00
|
|
|
}
|