This commit is contained in:
Alie 2023-11-29 20:07:14 +01:00
commit d9446653f0
6 changed files with 71 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
target/

30
Cargo.toml Normal file
View File

@ -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",
]

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# AOC2023
This is the repo I will use to make my solutions for AOC 2023

8
template/Cargo.toml Normal file
View File

@ -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]

0
template/input.txt Normal file
View File

29
template/src/main.rs Normal file
View File

@ -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);
}
}