diff --git a/2023/16/src/main.rs b/2023/16/src/main.rs index e2bae94..882367e 100644 --- a/2023/16/src/main.rs +++ b/2023/16/src/main.rs @@ -1,4 +1,4 @@ -use std::{fs::File, io::{BufReader, BufRead, Write}, ops::Add, fmt::Debug, hash::Hasher, sync::Arc}; +use std::{fs::File, io::{BufReader, BufRead, Write}, ops::Add, fmt::Debug, sync::Arc}; fn main() { // part1(); @@ -9,13 +9,13 @@ fn main() { #[derive(Debug, Clone, Copy, PartialEq, Eq)] enum Type { /// Mirror bottom-to-top (/) - MirrorBT, + MirrorBT = '/' as isize, /// Mirror top-to-bottom (\) - MirrorTB, + MirrorTB = '\\' as isize, /// Split horizontally (-) - SplitHorizontal, + SplitHorizontal = '-' as isize, /// Split vertically (|) - SplitVertical, + SplitVertical = '|' as isize } fn vectors_from_split(split: Type) -> (Vector, Vector) { @@ -167,6 +167,8 @@ fn get_map() -> Vec> { map } +const ALLOWED_CHARS: [char; 4] = ['/', '\\', '-', '|']; + fn get_rows_and_cols(map: Vec>) -> (Vec>, Vec>) { let rows: Vec> = map.iter().enumerate().map(|(y, row)| { row