mirror of
https://gitlab.com/MisterBiggs/aoc_2022-rust.git
synced 2025-06-15 22:56:50 +00:00
52 lines
1.1 KiB
Rust
52 lines
1.1 KiB
Rust
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);
|
|
// }
|
|
// }
|