From b90d770c8aee4ec108345d683f315dcb93b83987 Mon Sep 17 00:00:00 2001 From: JonOfUs Date: Sun, 8 Dec 2024 17:59:22 +0100 Subject: [PATCH] Prepare all days, allow params --- src/days/d09.rs | 16 ++++++++++++++++ src/days/d10.rs | 16 ++++++++++++++++ src/days/d11.rs | 16 ++++++++++++++++ src/days/d12.rs | 16 ++++++++++++++++ src/days/d13.rs | 16 ++++++++++++++++ src/days/d14.rs | 16 ++++++++++++++++ src/days/d15.rs | 16 ++++++++++++++++ src/days/d16.rs | 16 ++++++++++++++++ src/days/d17.rs | 16 ++++++++++++++++ src/days/d18.rs | 16 ++++++++++++++++ src/days/d19.rs | 16 ++++++++++++++++ src/days/d20.rs | 16 ++++++++++++++++ src/days/d21.rs | 16 ++++++++++++++++ src/days/d22.rs | 16 ++++++++++++++++ src/days/d23.rs | 16 ++++++++++++++++ src/days/d24.rs | 16 ++++++++++++++++ src/days/d25.rs | 16 ++++++++++++++++ src/main.rs | 38 ++++++++++++++++++-------------------- 18 files changed, 290 insertions(+), 20 deletions(-) create mode 100644 src/days/d09.rs create mode 100644 src/days/d10.rs create mode 100644 src/days/d11.rs create mode 100644 src/days/d12.rs create mode 100644 src/days/d13.rs create mode 100644 src/days/d14.rs create mode 100644 src/days/d15.rs create mode 100644 src/days/d16.rs create mode 100644 src/days/d17.rs create mode 100644 src/days/d18.rs create mode 100644 src/days/d19.rs create mode 100644 src/days/d20.rs create mode 100644 src/days/d21.rs create mode 100644 src/days/d22.rs create mode 100644 src/days/d23.rs create mode 100644 src/days/d24.rs create mode 100644 src/days/d25.rs diff --git a/src/days/d09.rs b/src/days/d09.rs new file mode 100644 index 0000000..12f46ab --- /dev/null +++ b/src/days/d09.rs @@ -0,0 +1,16 @@ +use std::fs; + +pub fn solve() { + let path = "res/09/input"; + + #[allow(unused)] + let contents = fs::read_to_string(path).expect("Something went wrong reading the file"); + + let result: usize = 0; + + println!("Result 1: {}", result); + + let result: usize = 0; + + println!("Result 2: {}", result); +} diff --git a/src/days/d10.rs b/src/days/d10.rs new file mode 100644 index 0000000..0bb7f55 --- /dev/null +++ b/src/days/d10.rs @@ -0,0 +1,16 @@ +use std::fs; + +pub fn solve() { + let path = "res/10/input"; + + #[allow(unused)] + let contents = fs::read_to_string(path).expect("Something went wrong reading the file"); + + let result: usize = 0; + + println!("Result 1: {}", result); + + let result: usize = 0; + + println!("Result 2: {}", result); +} diff --git a/src/days/d11.rs b/src/days/d11.rs new file mode 100644 index 0000000..3e321f8 --- /dev/null +++ b/src/days/d11.rs @@ -0,0 +1,16 @@ +use std::fs; + +pub fn solve() { + let path = "res/11/input"; + + #[allow(unused)] + let contents = fs::read_to_string(path).expect("Something went wrong reading the file"); + + let result: usize = 0; + + println!("Result 1: {}", result); + + let result: usize = 0; + + println!("Result 2: {}", result); +} diff --git a/src/days/d12.rs b/src/days/d12.rs new file mode 100644 index 0000000..dae91d2 --- /dev/null +++ b/src/days/d12.rs @@ -0,0 +1,16 @@ +use std::fs; + +pub fn solve() { + let path = "res/12/input"; + + #[allow(unused)] + let contents = fs::read_to_string(path).expect("Something went wrong reading the file"); + + let result: usize = 0; + + println!("Result 1: {}", result); + + let result: usize = 0; + + println!("Result 2: {}", result); +} diff --git a/src/days/d13.rs b/src/days/d13.rs new file mode 100644 index 0000000..e4ea3f9 --- /dev/null +++ b/src/days/d13.rs @@ -0,0 +1,16 @@ +use std::fs; + +pub fn solve() { + let path = "res/13/input"; + + #[allow(unused)] + let contents = fs::read_to_string(path).expect("Something went wrong reading the file"); + + let result: usize = 0; + + println!("Result 1: {}", result); + + let result: usize = 0; + + println!("Result 2: {}", result); +} diff --git a/src/days/d14.rs b/src/days/d14.rs new file mode 100644 index 0000000..974dcc9 --- /dev/null +++ b/src/days/d14.rs @@ -0,0 +1,16 @@ +use std::fs; + +pub fn solve() { + let path = "res/14/input"; + + #[allow(unused)] + let contents = fs::read_to_string(path).expect("Something went wrong reading the file"); + + let result: usize = 0; + + println!("Result 1: {}", result); + + let result: usize = 0; + + println!("Result 2: {}", result); +} diff --git a/src/days/d15.rs b/src/days/d15.rs new file mode 100644 index 0000000..785ef22 --- /dev/null +++ b/src/days/d15.rs @@ -0,0 +1,16 @@ +use std::fs; + +pub fn solve() { + let path = "res/15/input"; + + #[allow(unused)] + let contents = fs::read_to_string(path).expect("Something went wrong reading the file"); + + let result: usize = 0; + + println!("Result 1: {}", result); + + let result: usize = 0; + + println!("Result 2: {}", result); +} diff --git a/src/days/d16.rs b/src/days/d16.rs new file mode 100644 index 0000000..8bd87be --- /dev/null +++ b/src/days/d16.rs @@ -0,0 +1,16 @@ +use std::fs; + +pub fn solve() { + let path = "res/16/input"; + + #[allow(unused)] + let contents = fs::read_to_string(path).expect("Something went wrong reading the file"); + + let result: usize = 0; + + println!("Result 1: {}", result); + + let result: usize = 0; + + println!("Result 2: {}", result); +} diff --git a/src/days/d17.rs b/src/days/d17.rs new file mode 100644 index 0000000..fe7d17c --- /dev/null +++ b/src/days/d17.rs @@ -0,0 +1,16 @@ +use std::fs; + +pub fn solve() { + let path = "res/17/input"; + + #[allow(unused)] + let contents = fs::read_to_string(path).expect("Something went wrong reading the file"); + + let result: usize = 0; + + println!("Result 1: {}", result); + + let result: usize = 0; + + println!("Result 2: {}", result); +} diff --git a/src/days/d18.rs b/src/days/d18.rs new file mode 100644 index 0000000..e087fd1 --- /dev/null +++ b/src/days/d18.rs @@ -0,0 +1,16 @@ +use std::fs; + +pub fn solve() { + let path = "res/18/input"; + + #[allow(unused)] + let contents = fs::read_to_string(path).expect("Something went wrong reading the file"); + + let result: usize = 0; + + println!("Result 1: {}", result); + + let result: usize = 0; + + println!("Result 2: {}", result); +} diff --git a/src/days/d19.rs b/src/days/d19.rs new file mode 100644 index 0000000..1bcd6d1 --- /dev/null +++ b/src/days/d19.rs @@ -0,0 +1,16 @@ +use std::fs; + +pub fn solve() { + let path = "res/19/input"; + + #[allow(unused)] + let contents = fs::read_to_string(path).expect("Something went wrong reading the file"); + + let result: usize = 0; + + println!("Result 1: {}", result); + + let result: usize = 0; + + println!("Result 2: {}", result); +} diff --git a/src/days/d20.rs b/src/days/d20.rs new file mode 100644 index 0000000..4d71631 --- /dev/null +++ b/src/days/d20.rs @@ -0,0 +1,16 @@ +use std::fs; + +pub fn solve() { + let path = "res/20/input"; + + #[allow(unused)] + let contents = fs::read_to_string(path).expect("Something went wrong reading the file"); + + let result: usize = 0; + + println!("Result 1: {}", result); + + let result: usize = 0; + + println!("Result 2: {}", result); +} diff --git a/src/days/d21.rs b/src/days/d21.rs new file mode 100644 index 0000000..beb5111 --- /dev/null +++ b/src/days/d21.rs @@ -0,0 +1,16 @@ +use std::fs; + +pub fn solve() { + let path = "res/21/input"; + + #[allow(unused)] + let contents = fs::read_to_string(path).expect("Something went wrong reading the file"); + + let result: usize = 0; + + println!("Result 1: {}", result); + + let result: usize = 0; + + println!("Result 2: {}", result); +} diff --git a/src/days/d22.rs b/src/days/d22.rs new file mode 100644 index 0000000..6bd0790 --- /dev/null +++ b/src/days/d22.rs @@ -0,0 +1,16 @@ +use std::fs; + +pub fn solve() { + let path = "res/22/input"; + + #[allow(unused)] + let contents = fs::read_to_string(path).expect("Something went wrong reading the file"); + + let result: usize = 0; + + println!("Result 1: {}", result); + + let result: usize = 0; + + println!("Result 2: {}", result); +} diff --git a/src/days/d23.rs b/src/days/d23.rs new file mode 100644 index 0000000..25ae6dd --- /dev/null +++ b/src/days/d23.rs @@ -0,0 +1,16 @@ +use std::fs; + +pub fn solve() { + let path = "res/23/input"; + + #[allow(unused)] + let contents = fs::read_to_string(path).expect("Something went wrong reading the file"); + + let result: usize = 0; + + println!("Result 1: {}", result); + + let result: usize = 0; + + println!("Result 2: {}", result); +} diff --git a/src/days/d24.rs b/src/days/d24.rs new file mode 100644 index 0000000..2e72fb0 --- /dev/null +++ b/src/days/d24.rs @@ -0,0 +1,16 @@ +use std::fs; + +pub fn solve() { + let path = "res/24/input"; + + #[allow(unused)] + let contents = fs::read_to_string(path).expect("Something went wrong reading the file"); + + let result: usize = 0; + + println!("Result 1: {}", result); + + let result: usize = 0; + + println!("Result 2: {}", result); +} diff --git a/src/days/d25.rs b/src/days/d25.rs new file mode 100644 index 0000000..0bdd10b --- /dev/null +++ b/src/days/d25.rs @@ -0,0 +1,16 @@ +use std::fs; + +pub fn solve() { + let path = "res/25/input"; + + #[allow(unused)] + let contents = fs::read_to_string(path).expect("Something went wrong reading the file"); + + let result: usize = 0; + + println!("Result 1: {}", result); + + let result: usize = 0; + + println!("Result 2: {}", result); +} diff --git a/src/main.rs b/src/main.rs index 6f7382d..2f17380 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,23 +16,23 @@ fn main() { "6" => days::d06::solve(), "7" => days::d07::solve(), "8" => days::d08::solve(), - //"9" => days::d09::solve(), - //"10" => days::d10::solve(), - //"11" => days::d11::solve(), - //"12" => days::d12::solve(), - //"13" => days::d13::solve(), - //"14" => days::d14::solve(), - //"15" => days::d15::solve(), - //"16" => days::d16::solve(), - //"17" => days::d17::solve(), - //"18" => days::d18::solve(), - //"19" => days::d19::solve(), - //"20" => days::d20::solve(), - //"21" => days::d21::solve(), - //"22" => days::d22::solve(), - //"23" => days::d23::solve(), - //"24" => days::d24::solve(), - //"25" => days::d25::solve(), + "9" => days::d09::solve(), + "10" => days::d10::solve(), + "11" => days::d11::solve(), + "12" => days::d12::solve(), + "13" => days::d13::solve(), + "14" => days::d14::solve(), + "15" => days::d15::solve(), + "16" => days::d16::solve(), + "17" => days::d17::solve(), + "18" => days::d18::solve(), + "19" => days::d19::solve(), + "20" => days::d20::solve(), + "21" => days::d21::solve(), + "22" => days::d22::solve(), + "23" => days::d23::solve(), + "24" => days::d24::solve(), + "25" => days::d25::solve(), _ => println!("Day not implemented"), } } @@ -78,7 +78,6 @@ fn all_days() { days::d08::solve(); time = _print_elapsed(time); - /* println!("\nDay 9"); days::d09::solve(); time = _print_elapsed(time); @@ -131,7 +130,6 @@ fn all_days() { days::d21::solve(); time = _print_elapsed(time); - println!("\nDay 22"); days::d22::solve(); time = _print_elapsed(time); @@ -146,7 +144,7 @@ fn all_days() { println!("\nDay 25"); days::d25::solve(); - _print_elapsed(time);*/ + _print_elapsed(time); println!("\nTotal elapsed: {}ms", start.elapsed().as_millis()) }