diff --git a/src/day11/mod.rs b/src/day11/mod.rs index 727a0e3..3c97ca9 100644 --- a/src/day11/mod.rs +++ b/src/day11/mod.rs @@ -8,8 +8,29 @@ pub fn part_two() { #[allow(dead_code)] pub fn part_one() { let input = setup(); + + let mut galaxies = extract(input); } +fn extract(symbols: Vec>) -> Vec { + let mut galaxies = Vec::new(); + + for (y, line) in symbols.iter().enumerate() { + for (x, symbol) in line.iter().enumerate() { + if symbol.as_str() == "." { continue; } + galaxies.push(Galaxy { x, y }); + } + } + + galaxies +} + +struct Galaxy { + x: usize, + y: usize, +} + + fn setup() -> Vec> { let name = "day11"; println!("Executing module '{name}' entrypoint . . . ");