Start of implementation for 2023 day4 part 1
This commit is contained in:
parent
c7a4fbd9b8
commit
d636cbf5f9
@ -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!();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user