diff --git a/aoc_01/src/main.rs b/aoc_01/src/main.rs index 92b51f2..d086b39 100644 --- a/aoc_01/src/main.rs +++ b/aoc_01/src/main.rs @@ -3,11 +3,11 @@ use std::io::{self, BufRead}; use std::path::Path; fn main() { - let file_path = String::from("/home/wafoo/advent_of_code_2022/aoc_01/input"); + let file_path = String::from("input"); let mut result_vec = Vec::::new(); - + result_vec.push(0); - + println!("In file {}", file_path); if let Ok(lines) = read_lines(file_path) { @@ -22,7 +22,7 @@ fn main() { } } } - } + } } let index = result_vec.len() - 1; @@ -35,4 +35,4 @@ fn read_lines

(filename: P) -> io::Result>> where P: AsRef, { let file = File::open(filename)?; Ok(io::BufReader::new(file).lines()) -} \ No newline at end of file +} diff --git a/aoc_02/src/main.rs b/aoc_02/src/main.rs index 5934246..c068001 100644 --- a/aoc_02/src/main.rs +++ b/aoc_02/src/main.rs @@ -3,9 +3,9 @@ use std::io::{self, BufRead}; use std::path::Path; fn main() { - let file_path = String::from("/home/wafoo/advent_of_code_2022/aoc_02/input"); + let file_path = String::from("input"); let mut result = 0; - + println!("In file {}", file_path); if let Ok(lines) = read_lines(file_path) { @@ -25,7 +25,7 @@ fn main() { _ => result += 0, } } - } + } } println!("{}", result); @@ -35,4 +35,4 @@ fn read_lines

(filename: P) -> io::Result>> where P: AsRef, { let file = File::open(filename)?; Ok(io::BufReader::new(file).lines()) -} \ No newline at end of file +} diff --git a/aoc_03a/src/main.rs b/aoc_03a/src/main.rs index 63d3db1..34924eb 100644 --- a/aoc_03a/src/main.rs +++ b/aoc_03a/src/main.rs @@ -4,9 +4,9 @@ use std::path::Path; use std::collections::HashMap; fn main() { - let file_path = String::from("/home/wafoo/advent_of_code_2022/aoc_03a/input"); + let file_path = String::from("input"); let mut result = 0; - + println!("In file {}", file_path); if let Ok(lines) = read_lines(file_path) { @@ -37,7 +37,7 @@ fn main() { i += 1; } } - } + } } println!("{}", result); @@ -47,4 +47,4 @@ fn read_lines

(filename: P) -> io::Result>> where P: AsRef, { let file = File::open(filename)?; Ok(io::BufReader::new(file).lines()) -} \ No newline at end of file +} diff --git a/aoc_03b/src/main.rs b/aoc_03b/src/main.rs index e5dd9a4..a188639 100644 --- a/aoc_03b/src/main.rs +++ b/aoc_03b/src/main.rs @@ -4,7 +4,7 @@ use std::path::Path; use std::collections::HashMap; fn main() { - let file_path = String::from("/home/wafoo/advent_of_code_2022/aoc_03a/input"); + let file_path = String::from("../aoc_03a/input"); let mut result = 0; let mut i = 0; let mut hashmap = HashMap::new(); @@ -46,7 +46,7 @@ fn main() { } } i = (i + 1) % 3; - } + } } println!("{}", result); @@ -56,4 +56,4 @@ fn read_lines

(filename: P) -> io::Result>> where P: AsRef, { let file = File::open(filename)?; Ok(io::BufReader::new(file).lines()) -} \ No newline at end of file +} diff --git a/aoc_04a/src/main.rs b/aoc_04a/src/main.rs index 578c1c9..708ce18 100644 --- a/aoc_04a/src/main.rs +++ b/aoc_04a/src/main.rs @@ -3,7 +3,7 @@ use std::io::{self, BufRead}; use std::path::Path; fn main() { - let file_path = String::from("/home/wafoo/advent_of_code_2022/aoc_04a/input"); + let file_path = String::from("input"); let mut result = 0; println!("In file {}", file_path); @@ -24,7 +24,7 @@ fn main() { result += 1; } } - } + } } println!("{}", result); @@ -34,4 +34,4 @@ fn read_lines

(filename: P) -> io::Result>> where P: AsRef, { let file = File::open(filename)?; Ok(io::BufReader::new(file).lines()) -} \ No newline at end of file +} diff --git a/aoc_04b/src/main.rs b/aoc_04b/src/main.rs index c522702..7502748 100644 --- a/aoc_04b/src/main.rs +++ b/aoc_04b/src/main.rs @@ -3,7 +3,7 @@ use std::io::{self, BufRead}; use std::path::Path; fn main() { - let file_path = String::from("/home/wafoo/advent_of_code_2022/aoc_04a/input"); + let file_path = String::from("../aoc_04a/input"); let mut result = 0; println!("In file {}", file_path); @@ -24,7 +24,7 @@ fn main() { result += 1; } } - } + } } println!("{}", result); @@ -34,4 +34,4 @@ fn read_lines

(filename: P) -> io::Result>> where P: AsRef, { let file = File::open(filename)?; Ok(io::BufReader::new(file).lines()) -} \ No newline at end of file +} diff --git a/aoc_05a/src/main.rs b/aoc_05a/src/main.rs index e2015cb..03d8a75 100644 --- a/aoc_05a/src/main.rs +++ b/aoc_05a/src/main.rs @@ -41,7 +41,7 @@ fn move_array(result: &mut Vec>, line: String) { } fn main() { - let file_path = String::from("/home/wafoo/advent_of_code_2022/aoc_05a/input"); + let file_path = String::from("input"); let mut result = Vec::>::new(); println!("In file {}", file_path); @@ -59,7 +59,7 @@ fn main() { } } } - } + } } let mut res = String::from(""); @@ -73,4 +73,4 @@ fn read_lines

(filename: P) -> io::Result>> where P: AsRef, { let file = File::open(filename)?; Ok(io::BufReader::new(file).lines()) -} \ No newline at end of file +} diff --git a/aoc_05b/src/main.rs b/aoc_05b/src/main.rs index a1cf1a1..986f224 100644 --- a/aoc_05b/src/main.rs +++ b/aoc_05b/src/main.rs @@ -40,7 +40,7 @@ fn move_array(result: &mut Vec>, line: String) { } fn main() { - let file_path = String::from("/home/wafoo/advent_of_code_2022/aoc_05a/input"); + let file_path = String::from("../aoc_05a/input"); let mut result = Vec::>::new(); println!("In file {}", file_path); @@ -58,7 +58,7 @@ fn main() { } } } - } + } } let mut res = String::from(""); @@ -72,4 +72,4 @@ fn read_lines

(filename: P) -> io::Result>> where P: AsRef, { let file = File::open(filename)?; Ok(io::BufReader::new(file).lines()) -} \ No newline at end of file +} diff --git a/aoc_06a/src/main.rs b/aoc_06a/src/main.rs index ff2083f..ed2311a 100644 --- a/aoc_06a/src/main.rs +++ b/aoc_06a/src/main.rs @@ -3,7 +3,7 @@ use std::io::{self, BufRead}; use std::path::Path; fn main() { - let file_path = String::from("/home/wafoo/advent_of_code_2022/aoc_06a/input2"); + let file_path = String::from("input"); let mut index = 4; println!("In file {}", file_path); @@ -24,7 +24,7 @@ fn main() { slice = &ip[(index - 4)..index]; } } - } + } } println!("{}", index); @@ -34,4 +34,4 @@ fn read_lines

(filename: P) -> io::Result>> where P: AsRef, { let file = File::open(filename)?; Ok(io::BufReader::new(file).lines()) -} \ No newline at end of file +} diff --git a/aoc_06b/src/main.rs b/aoc_06b/src/main.rs index d430575..e8f0ea6 100644 --- a/aoc_06b/src/main.rs +++ b/aoc_06b/src/main.rs @@ -4,7 +4,7 @@ use std::path::Path; use std::collections::HashMap; fn main() { - let file_path = String::from("/home/wafoo/advent_of_code_2022/aoc_06a/input"); + let file_path = String::from("../aoc_06a/input"); let mut index = 14; println!("In file {}", file_path); @@ -24,7 +24,7 @@ fn main() { index += 1; } } - } + } } println!("{}", index - 1); @@ -34,4 +34,4 @@ fn read_lines

(filename: P) -> io::Result>> where P: AsRef, { let file = File::open(filename)?; Ok(io::BufReader::new(file).lines()) -} \ No newline at end of file +}