AdventOfCode/template/bin/d.rs.tmpl

28 lines
790 B
Cheetah
Raw Normal View History

2024-12-10 11:45:53 +01:00
use std::{fs, time::Instant};
2024-11-01 16:52:33 +01:00
2024-12-10 11:45:53 +01:00
use utils::time::get_elapsed_string;
2024-11-01 16:52:33 +01:00
use y{{YEAR}}::days::d{{DAY}};
fn main() {
2024-12-10 11:45:53 +01:00
let now = Instant::now();
println!("Part 1:");
2024-11-01 16:52:33 +01:00
part1();
2024-12-10 11:45:53 +01:00
println!("Ran in {}", get_elapsed_string(now.elapsed()));
let now = Instant::now();
println!("Part 2:");
2024-11-01 16:52:33 +01:00
part2();
2024-12-10 11:45:53 +01:00
println!("Ran in {}", get_elapsed_string(now.elapsed()));
2024-11-01 16:52:33 +01:00
}
fn part1() {
let root = env!("CARGO_MANIFEST_DIR");
let content = fs::read_to_string(format!("{root}/resources/{{DAY}}_input.txt")).unwrap();
println!("{}", d{{DAY}}::process_part1(&content));
}
fn part2() {
let root = env!("CARGO_MANIFEST_DIR");
let content = fs::read_to_string(format!("{root}/resources/{{DAY}}_input.txt")).unwrap();
println!("{}", d{{DAY}}::process_part2(&content));
}