update contents

This commit is contained in:
Daniel Bulant 2024-06-25 11:25:47 +02:00
parent f805ca5640
commit 944eef9789
No known key found for this signature in database

View file

@ -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<Vec<char>> {
map
}
const ALLOWED_CHARS: [char; 4] = ['/', '\\', '-', '|'];
fn get_rows_and_cols(map: Vec<Vec<char>>) -> (Vec<Vec<MapPoint>>, Vec<Vec<MapPoint>>) {
let rows: Vec<Vec<MapPoint>> = map.iter().enumerate().map(|(y, row)| {
row