2024
This commit is contained in:
parent
294c0a8e62
commit
e1ca0d5f61
76 changed files with 4607 additions and 204 deletions
13
template/src/day01.rs
Normal file
13
template/src/day01.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day01;
|
||||
|
||||
impl Solution for Day01 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day02.rs
Normal file
13
template/src/day02.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day02;
|
||||
|
||||
impl Solution for Day02 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day03.rs
Normal file
13
template/src/day03.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day03;
|
||||
|
||||
impl Solution for Day03 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day04.rs
Normal file
13
template/src/day04.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day04;
|
||||
|
||||
impl Solution for Day04 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day05.rs
Normal file
13
template/src/day05.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day05;
|
||||
|
||||
impl Solution for Day05 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day06.rs
Normal file
13
template/src/day06.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day06;
|
||||
|
||||
impl Solution for Day06 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day07.rs
Normal file
13
template/src/day07.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day07;
|
||||
|
||||
impl Solution for Day07 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day08.rs
Normal file
13
template/src/day08.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day08;
|
||||
|
||||
impl Solution for Day08 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day09.rs
Normal file
13
template/src/day09.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day09;
|
||||
|
||||
impl Solution for Day09 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day10.rs
Normal file
13
template/src/day10.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day10;
|
||||
|
||||
impl Solution for Day10 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day11.rs
Normal file
13
template/src/day11.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day11;
|
||||
|
||||
impl Solution for Day11 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day12.rs
Normal file
13
template/src/day12.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day12;
|
||||
|
||||
impl Solution for Day12 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day13.rs
Normal file
13
template/src/day13.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day13;
|
||||
|
||||
impl Solution for Day13 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day14.rs
Normal file
13
template/src/day14.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day14;
|
||||
|
||||
impl Solution for Day14 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day15.rs
Normal file
13
template/src/day15.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day15;
|
||||
|
||||
impl Solution for Day15 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day16.rs
Normal file
13
template/src/day16.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day16;
|
||||
|
||||
impl Solution for Day16 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day17.rs
Normal file
13
template/src/day17.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day17;
|
||||
|
||||
impl Solution for Day17 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day18.rs
Normal file
13
template/src/day18.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day18;
|
||||
|
||||
impl Solution for Day18 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day19.rs
Normal file
13
template/src/day19.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day19;
|
||||
|
||||
impl Solution for Day19 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day20.rs
Normal file
13
template/src/day20.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day20;
|
||||
|
||||
impl Solution for Day20 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day21.rs
Normal file
13
template/src/day21.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day21;
|
||||
|
||||
impl Solution for Day21 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day22.rs
Normal file
13
template/src/day22.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day22;
|
||||
|
||||
impl Solution for Day22 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day23.rs
Normal file
13
template/src/day23.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day23;
|
||||
|
||||
impl Solution for Day23 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day24.rs
Normal file
13
template/src/day24.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day24;
|
||||
|
||||
impl Solution for Day24 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
13
template/src/day25.rs
Normal file
13
template/src/day25.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub struct Day25;
|
||||
|
||||
impl Solution for Day25 {
|
||||
fn part_1(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
|
||||
fn part_2(&self, input: &str) -> Answer {
|
||||
Answer::Unimplemented
|
||||
}
|
||||
}
|
||||
120
template/src/lib.rs
Normal file
120
template/src/lib.rs
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
use shared::{Solution, Answer};
|
||||
|
||||
pub use crate::day01::Day01;
|
||||
pub use crate::day02::Day02;
|
||||
pub use crate::day03::Day03;
|
||||
pub use crate::day04::Day04;
|
||||
pub use crate::day05::Day05;
|
||||
pub use crate::day06::Day06;
|
||||
pub use crate::day07::Day07;
|
||||
pub use crate::day08::Day08;
|
||||
pub use crate::day09::Day09;
|
||||
pub use crate::day10::Day10;
|
||||
pub use crate::day11::Day11;
|
||||
pub use crate::day12::Day12;
|
||||
pub use crate::day13::Day13;
|
||||
pub use crate::day14::Day14;
|
||||
pub use crate::day15::Day15;
|
||||
pub use crate::day16::Day16;
|
||||
pub use crate::day17::Day17;
|
||||
pub use crate::day18::Day18;
|
||||
pub use crate::day19::Day19;
|
||||
pub use crate::day20::Day20;
|
||||
pub use crate::day21::Day21;
|
||||
pub use crate::day22::Day22;
|
||||
pub use crate::day23::Day23;
|
||||
pub use crate::day24::Day24;
|
||||
pub use crate::day25::Day25;
|
||||
|
||||
pub fn solution(input: &str, day: usize, part: usize) -> Option<Answer> {
|
||||
match part {
|
||||
1 => match day {
|
||||
1 => Some(Day01.part_1(input)),
|
||||
2 => Some(Day02.part_1(input)),
|
||||
3 => Some(Day03.part_1(input)),
|
||||
4 => Some(Day04.part_1(input)),
|
||||
5 => Some(Day05.part_1(input)),
|
||||
6 => Some(Day06.part_1(input)),
|
||||
7 => Some(Day07.part_1(input)),
|
||||
8 => Some(Day08.part_1(input)),
|
||||
9 => Some(Day09.part_1(input)),
|
||||
10 => Some(Day10.part_1(input)),
|
||||
11 => Some(Day11.part_1(input)),
|
||||
12 => Some(Day12.part_1(input)),
|
||||
13 => Some(Day13.part_1(input)),
|
||||
14 => Some(Day14.part_1(input)),
|
||||
15 => Some(Day15.part_1(input)),
|
||||
16 => Some(Day16.part_1(input)),
|
||||
17 => Some(Day17.part_1(input)),
|
||||
18 => Some(Day18.part_1(input)),
|
||||
19 => Some(Day19.part_1(input)),
|
||||
20 => Some(Day20.part_1(input)),
|
||||
21 => Some(Day21.part_1(input)),
|
||||
22 => Some(Day22.part_1(input)),
|
||||
23 => Some(Day23.part_1(input)),
|
||||
24 => Some(Day24.part_1(input)),
|
||||
25 => Some(Day25.part_1(input)),
|
||||
_ => None
|
||||
},
|
||||
2 => match day {
|
||||
1 => Some(Day01.part_2(input)),
|
||||
2 => Some(Day02.part_2(input)),
|
||||
3 => Some(Day03.part_2(input)),
|
||||
4 => Some(Day04.part_2(input)),
|
||||
5 => Some(Day05.part_2(input)),
|
||||
6 => Some(Day06.part_2(input)),
|
||||
7 => Some(Day07.part_2(input)),
|
||||
8 => Some(Day08.part_2(input)),
|
||||
9 => Some(Day09.part_2(input)),
|
||||
10 => Some(Day10.part_2(input)),
|
||||
11 => Some(Day11.part_2(input)),
|
||||
12 => Some(Day12.part_2(input)),
|
||||
13 => Some(Day13.part_2(input)),
|
||||
14 => Some(Day14.part_2(input)),
|
||||
15 => Some(Day15.part_2(input)),
|
||||
16 => Some(Day16.part_2(input)),
|
||||
17 => Some(Day17.part_2(input)),
|
||||
18 => Some(Day18.part_2(input)),
|
||||
19 => Some(Day19.part_2(input)),
|
||||
20 => Some(Day20.part_2(input)),
|
||||
21 => Some(Day21.part_2(input)),
|
||||
22 => Some(Day22.part_2(input)),
|
||||
23 => Some(Day23.part_2(input)),
|
||||
24 => Some(Day24.part_2(input)),
|
||||
25 => Some(Day25.part_2(input)),
|
||||
_ => None
|
||||
},
|
||||
_ => None
|
||||
}
|
||||
}
|
||||
|
||||
mod day01;
|
||||
mod day02;
|
||||
mod day03;
|
||||
mod day04;
|
||||
mod day05;
|
||||
mod day06;
|
||||
mod day07;
|
||||
mod day08;
|
||||
mod day09;
|
||||
mod day10;
|
||||
mod day11;
|
||||
mod day12;
|
||||
mod day13;
|
||||
mod day14;
|
||||
mod day15;
|
||||
mod day16;
|
||||
mod day17;
|
||||
mod day18;
|
||||
mod day19;
|
||||
mod day20;
|
||||
mod day21;
|
||||
mod day22;
|
||||
mod day23;
|
||||
mod day24;
|
||||
mod day25;
|
||||
|
||||
#[test]
|
||||
fn examples() {
|
||||
todo!()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue