Start of implementation for 2023 day4 part 1

This commit is contained in:
Timothy Warren 2023-12-07 16:56:02 -05:00
parent c7a4fbd9b8
commit d636cbf5f9

View File

@ -1,5 +1,31 @@
use std::collections::HashMap;
const FILE_STR: &'static str = include_str!("input.txt"); const FILE_STR: &'static str = include_str!("input.txt");
#[derive(Default)]
struct ScratchCard {
winning: Vec<usize>,
chosen: Vec<usize>,
}
impl ScratchCard {
fn new(winning: Vec<usize>, chosen: Vec<usize>) -> Self {
ScratchCard { winning, chosen }
}
}
type GameMap = HashMap<usize, ScratchCard>;
fn parse_game_table(table: &str) -> GameMap {
let mut map = HashMap::new();
table.split('\n').for_each(|line| {
todo!();
});
map
}
fn part_one() { fn part_one() {
todo!(); todo!();
} }