wip: boilerplate day4

This commit is contained in:
pasterp 2023-12-04 16:57:49 +01:00
parent 31aa321e68
commit f03c3dc4b4
2 changed files with 32 additions and 0 deletions

26
src/day4/mod.rs Normal file
View File

@ -0,0 +1,26 @@
use super::utils::Part;
struct Card {
nb_winning: u32
}
pub fn parse(line: &str) -> Card {
let (_, values) = line.split_once(':').unwrap();
let (winning, numbers) = values.split_once('|').unwrap();
todo!()
}
pub fn solve(lines: Vec<String>, part: Part) -> u32 {
todo!()
}
#[cfg(test)]
mod tests {
#[test]
fn test_line() {
let line = "Card 1: 41 48 83 86 17 | 83 86 6 31 17 9 48 53".to_owned();
}
}

View File

@ -3,7 +3,9 @@
mod day1;
mod day2;
mod day3;
mod day4;
mod utils;
use log::info;
use utils::Part;
@ -14,6 +16,10 @@ fn main() {
.filter_level(log::LevelFilter::Debug)
.format_timestamp(None)
.init();
let data_path = "./datasets/adventofcode.com_2023_day_4_input.txt";
let result = day4::solve(utils::lines_from_file(data_path).expect("Could not load the dataset for day 3"), Part::One);
info!("Result : {}", result);
}