From 52d5b5949cbb110d0a69c1d5073502f542988dde Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Sun, 28 Jan 2024 00:02:20 +0100 Subject: [PATCH] introduce struct to keep track of city blocks --- src/day17/mod.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/day17/mod.rs b/src/day17/mod.rs index f3e7140..0509cbe 100644 --- a/src/day17/mod.rs +++ b/src/day17/mod.rs @@ -8,6 +8,14 @@ pub fn part_one() { let input = setup(); } +fn pathfind(grid: &mut Vec>) -> i32 { +} + +struct Block { + x: usize, + y: usize, +} + fn setup() -> Vec> { let name = "day17"; println!("Executing module '{name}' entrypoint . . . "); @@ -17,4 +25,19 @@ fn setup() -> Vec> { let input = match_inputs(lines, &r"."); convert_num(input) + .iter() + .enumerate() + .map(|(j, v)| { + v.iter() + .enumerate() + .map(|(i, n)| Block { + x: i, + y: j, + c: *n, + d: 0, + h: 0, + }) + .collect() + }) + .collect() }