commit d9446653f0378b3250ae12a2ccb9932eb9fd2fb6 Author: Alie Date: Wed Nov 29 20:07:14 2023 +0100 bacalao diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2f7896d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +target/ diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..4c1c501 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,30 @@ +[workspace] + +members = [ + "template", +# "day01", +# "day02", +# "day03", +# "day04", +# "day05", +# "day06", +# "day07", +# "day08", +# "day09", +# "day10", +# "day11", +# "day12", +# "day13", +# "day14", +# "day15", +# "day16", +# "day17", +# "day18", +# "day19", +# "day20", +# "day21", +# "day22", +# "day23", +# "day24", +# "day25", +] diff --git a/README.md b/README.md new file mode 100644 index 0000000..90bb0cd --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# AOC2023 + +This is the repo I will use to make my solutions for AOC 2023 \ No newline at end of file diff --git a/template/Cargo.toml b/template/Cargo.toml new file mode 100644 index 0000000..a13e012 --- /dev/null +++ b/template/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "template" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/template/input.txt b/template/input.txt new file mode 100644 index 0000000..e69de29 diff --git a/template/src/main.rs b/template/src/main.rs new file mode 100644 index 0000000..a1789f9 --- /dev/null +++ b/template/src/main.rs @@ -0,0 +1,29 @@ +fn main() { + const FILE_PATH: &str = "input.txt"; + println!("Welcome to AOC2023 day NUMBER, first we will read the file {}", FILE_PATH); + let contents = fs::read_to_string(FILE_PATH) + .expect("Should have been able to read the file"); + + println!("And we parse the file!"); + let mut data = parse(&contents); + println!("First thing: {}", calculate_1(&data)); + println!("Second thing: {}", calculate_2(&data)); + +} + + +#[cfg(test)] +mod test { + const INPUT: &str = r#""#; + use super::*; + #[test] + fn test1() { + let tst = parse(INPUT); + assert_eq!(calculate_1(&tst), 24000); + } + #[test] + fn test2() { + let tst = parse(INPUT); + assert_eq!(calculate_2(&tst), 24000); + } +} \ No newline at end of file