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() { fn main() {
// part1(); // part1();
@ -9,13 +9,13 @@ fn main() {
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum Type { enum Type {
/// Mirror bottom-to-top (/) /// Mirror bottom-to-top (/)
MirrorBT, MirrorBT = '/' as isize,
/// Mirror top-to-bottom (\) /// Mirror top-to-bottom (\)
MirrorTB, MirrorTB = '\\' as isize,
/// Split horizontally (-) /// Split horizontally (-)
SplitHorizontal, SplitHorizontal = '-' as isize,
/// Split vertically (|) /// Split vertically (|)
SplitVertical, SplitVertical = '|' as isize
} }
fn vectors_from_split(split: Type) -> (Vector, Vector) { fn vectors_from_split(split: Type) -> (Vector, Vector) {
@ -167,6 +167,8 @@ fn get_map() -> Vec<Vec<char>> {
map map
} }
const ALLOWED_CHARS: [char; 4] = ['/', '\\', '-', '|'];
fn get_rows_and_cols(map: Vec<Vec<char>>) -> (Vec<Vec<MapPoint>>, Vec<Vec<MapPoint>>) { 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)| { let rows: Vec<Vec<MapPoint>> = map.iter().enumerate().map(|(y, row)| {
row row