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:
51
src/day1.rs
Normal file
51
src/day1.rs
Normal 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
5
src/main.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
mod day1;
|
||||
fn main() {
|
||||
println!("Running Advent of Code 2022");
|
||||
day1::run();
|
||||
}
|
Reference in New Issue
Block a user