use std::{fs, io::Read}; pub mod prelude { pub use std::error::Error; } pub fn read_input(day: usize) -> String { let mut s = String::new(); let path = if let Some(arg) = std::env::args().nth(1) { if arg == "-" { std::io::stdin().read_to_string(&mut s).unwrap(); return s; } arg } else { format!("day{}/input", day) }; fs::read_to_string(path).expect("Could not read input") }