1
0
mirror of https://gitlab.com/MisterBiggs/aoc-2023-rust.git synced 2025-07-23 22:51:32 +00:00

Initialize repo

This commit is contained in:
2022-12-01 15:19:09 -07:00
commit 971581dd85
6 changed files with 2304 additions and 0 deletions

51
src/day1.rs Normal file
View File

@@ -0,0 +1,51 @@
use std::fs;
pub fn run() {
println!("Day 1:");
let input = fs::read_to_string("./inputs/day1.txt").expect("Could not read file");
println!("\tPart 1: {}", part1(&input));
println!("\tPart 2: {}", part2(&input));
}
fn part1(food_list: &str) -> isize {
todo!()
}
fn part2(food_list: &str) -> usize {
todo!()
}
// #[cfg(test)]
// mod tests {
// use super::*;
// #[test]
// fn test_1() {
// let mut input = "(())".to_string();
// assert_eq!(part1(&input), 0);
// input = "()()".to_string();
// assert_eq!(part1(&input), 0);
// input = "(((".to_string();
// assert_eq!(part1(&input), 3);
// input = "(()(()(".to_string();
// assert_eq!(part1(&input), 3);
// input = "())".to_string();
// assert_eq!(part1(&input), -1);
// input = ")())())".to_string();
// assert_eq!(part1(&input), -3);
// }
// #[test]
// fn test_2() {
// let mut input = ")".to_string();
// assert_eq!(part2(&input), 1);
// input = "()())".to_string();
// assert_eq!(part2(&input), 5);
// }
// }

5
src/main.rs Normal file
View File

@@ -0,0 +1,5 @@
mod day1;
fn main() {
println!("Running Advent of Code 2022");
day1::run();
}