Better output for each problem.
This commit is contained in:
parent
da873ef463
commit
29956ee857
18
src/main.rs
18
src/main.rs
@ -1,10 +1,16 @@
|
|||||||
use advent_of_code::{prob1, prob2};
|
use advent_of_code::{prob1, prob2};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let args: Vec<String> = std::env::args().collect();
|
{
|
||||||
let file_path = args
|
let file_path = "prob1.txt";
|
||||||
.get(1)
|
let max_part1 = prob1::solve_part1(file_path);
|
||||||
.expect("Please provide an argument on command-line.");
|
let max_part2 = prob1::solve_part2(file_path);
|
||||||
let max = prob2::solve_part2(file_path);
|
println!("Solution for problem 1 part 1: {max_part1}\nSolution for problem 1 part 2: {max_part2}");
|
||||||
println!("{max}");
|
}
|
||||||
|
{
|
||||||
|
let file_path = "prob2_part1.txt";
|
||||||
|
let max_part1 = prob2::solve_part1(file_path);
|
||||||
|
let max_part2 = prob2::solve_part2(file_path);
|
||||||
|
println!("Solution for problem 2 part 1: {max_part1}\nSolution for problem 2 part 2: {max_part2}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user