diff --git a/2022/input/1/test-1 b/2022/input/1/test-1 index 51a384d..2094f91 100644 --- a/2022/input/1/test-1 +++ b/2022/input/1/test-1 @@ -1,5 +1,3 @@ -24000 -45000 1000 2000 3000 diff --git a/2022/src/bin/day1.rs b/2022/src/bin/day1.rs index d523c48..6710da9 100644 --- a/2022/src/bin/day1.rs +++ b/2022/src/bin/day1.rs @@ -1,23 +1,32 @@ +// -- Setup & Runners -- use aoc::Solver; - -pub struct Day {} +pub struct Day; fn main() { Day::solve(); } #[test] -fn part1() { +fn part1_test1() { Day::test(aoc::Part::ONE, "test-1", 24000); } #[test] -fn part2() { +fn part2_test1() { Day::test(aoc::Part::TWO, "test-1", 45000); } +#[test] +fn part1_solution() { + Day::test(aoc::Part::ONE, "input", 70116); +} +#[test] +fn part2_solution() { + Day::test(aoc::Part::TWO, "input", 206582); +} - +// -- Solution -- impl aoc::Solver for Day { fn day() -> u8 { 1 } + fn part1(input: &str) -> u32 { input.split("\n\n") .map(|elf| elf.split("\n") diff --git a/2022/src/bin/template.rs b/2022/src/bin/template.rs index d3eb9dc..a359efc 100644 --- a/2022/src/bin/template.rs +++ b/2022/src/bin/template.rs @@ -1,24 +1,25 @@ +// -- Setup & Runners -- use aoc::Solver; - -pub struct Day {} +pub struct Day; fn main() { Day::solve(); } #[test] -fn part1() { +fn part1_test1() { Day::test(aoc::Part::ONE, "test-1", 0); } - +// -- Solution -- impl aoc::Solver for Day { fn day() -> u8 { 0 } + fn part1(input: &str) -> u32 { - input.len() as u32 + 0 } fn part2(input: &str) -> u32 { - input.len() as u32 + 0 } }