mirror of
https://github.com/danbulant/adventOfCode
synced 2026-06-24 16:31:44 +00:00
update contents
This commit is contained in:
parent
f805ca5640
commit
944eef9789
1 changed files with 7 additions and 5 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue