summaryrefslogtreecommitdiff
path: root/2023
diff options
context:
space:
mode:
authornekineki <nekineki@nekineki.net>2023-12-13 09:06:28 +0100
committernekineki <nekineki@nekineki.net>2023-12-13 09:06:28 +0100
commit8eb7e8495cb3df4ccae5f162c1dfbd66229fdfe4 (patch)
tree7cd3d71dc14f3545aa5945d591a63a447783c81d /2023
parent085d6eb1b6bb18b3214c5902208a533f025d143d (diff)
day13 part1. part2 bi mogu delat
Diffstat (limited to '2023')
-rw-r--r--2023/day13.rs126
-rw-r--r--2023/in/day13.pzl1339
-rw-r--r--2023/in/day13.ref15
3 files changed, 1480 insertions, 0 deletions
diff --git a/2023/day13.rs b/2023/day13.rs
new file mode 100644
index 0000000..b2f2b05
--- /dev/null
+++ b/2023/day13.rs
@@ -0,0 +1,126 @@
+#![allow(dead_code)]
+#![allow(unused_variables)]
+#![allow(unused_mut)]
+use std::fs::File;
+use std::io::Read;
+
+fn transpose<T>(original: Vec<Vec<T>>) -> Vec<Vec<T>> {
+ assert!(!original.is_empty());
+ let mut transposed = (0..original[0].len()).map(|_| vec![]).collect::<Vec<_>>();
+
+ for original_row in original {
+ for (item, transposed_row) in original_row.into_iter().zip(&mut transposed) {
+ transposed_row.push(item);
+ }
+ }
+ transposed
+}
+
+fn lines_mirrored(arr: &Vec<Vec<bool>>, start: usize) -> bool {
+ for (i, j) in (0..=start).rev().zip(start + 1..arr.len()) {
+ if arr[i] != arr[j] {
+ return false;
+ }
+ }
+ return true;
+}
+
+fn mirror_horizontal_line(arr: &Vec<Vec<bool>>) -> usize {
+ for i in 0..arr.len() - 1 {
+ if lines_mirrored(arr, i) {
+ return i + 1;
+ }
+ }
+ return 0;
+}
+
+fn print_arr(arr: &Vec<Vec<bool>>) {
+ for i in 0..arr.len() {
+ for j in 0..arr[0].len() {
+ if arr[i][j] == true {
+ print!("#");
+ } else {
+ print!(".");
+ }
+ }
+ println!("");
+ }
+ println!("");
+}
+
+fn main() {
+ // let filename = "in/day13.ref";
+ let filename = "in/day13.pzl";
+
+ let mut f = File::open(filename).expect("cannot open file");
+ let mut content = String::new();
+ f.read_to_string(&mut content).expect("cannot read file");
+ let groups = content.trim_end().split("\n\n");
+
+ let mut res1 = 0;
+ let mut res2 = 0;
+
+ for group in groups {
+ let mut arr: Vec<Vec<bool>> = Vec::new();
+ for line in group.split("\n") {
+ let mut l: Vec<bool> = Vec::new();
+ for c in line.chars() {
+ l.push(if c == '#' { true } else { false });
+ }
+ arr.push(l);
+ }
+
+ let (x, y) = (
+ mirror_horizontal_line(&transpose(arr.clone())),
+ mirror_horizontal_line(&arr),
+ );
+ res1 += x + 100 * y;
+ println!("aaa {x} {y}");
+
+ if x != 0 && y != 0 {
+ panic!("asdf");
+ }
+
+ 'outer: for i in 0..arr.len() {
+ for j in 0..arr[0].len() {
+ let mut a = arr.clone();
+ a[i][j] ^= true;
+ let (x2, y2) = (
+ mirror_horizontal_line(&transpose(a.clone())),
+ mirror_horizontal_line(&a),
+ );
+
+ if x == 0 {
+ if (y != y2) && (y2 != 0) {
+ println!("a {x} {y}, {x2} {y2}");
+ print_arr(&a);
+ res2 += 100 * y2;
+ break 'outer;
+ } else if x2 != 0 {
+ println!("b {x} {y}, {x2} {y2}");
+ print_arr(&a);
+ res2 += x2;
+ break 'outer;
+ }
+ }
+
+ if y == 0 {
+ if y2 != 0 {
+ println!("c {x} {y}, {x2} {y2}");
+ print_arr(&a);
+ res2 += 100 * y2;
+ break 'outer;
+ } else if (x != x2) && (x2 != 0) {
+ println!("d {x} {y}, {x2} {y2}");
+ print_arr(&a);
+ res2 += x2;
+ break 'outer;
+ }
+ }
+ }
+ }
+ }
+
+ println!("res1: {}", res1);
+ println!("res2: {}", res2);
+}
diff --git a/2023/in/day13.pzl b/2023/in/day13.pzl
new file mode 100644
index 0000000..83d53a2
--- /dev/null
+++ b/2023/in/day13.pzl
@@ -0,0 +1,1339 @@
+.###...####..
+###...#....#.
+###...#....#.
+.###...####..
+###.#........
+#####.#....#.
+##.#..######.
+####.#..##..#
+..#....####..
+#.##.##.##.##
+#.#...#.##.#.
+.###.##.##.##
+#.#....#..#..
+..###.##..##.
+##.#..#....##
+
+....#..#####...
+....#.##.#..##.
+......#.#.###..
+.##........##.#
+######..#..#.#.
+....#.#.#.#..#.
+#..##...#...###
+.##..###.######
+.##..#.#.#....#
+.##...####.#.##
+.....#....#####
+.....#....#####
+.##...######.##
+.##..#.#.#....#
+.##..###.######
+#..##...#...###
+....#.#.#.#..#.
+
+.#..#..####
+.#....#.###
+...#####..#
+##..#.#.###
+.####.###..
+.#.#..#####
+##.##..##..
+##.##..##..
+.#.#..#####
+
+#..##...###
+#..##..#...
+#..##..#...
+#..##...###
+#####..#.##
+#.##..#####
+#..####.#.#
+.##.#.#.#..
+.....#####.
+####..#####
+#..#.#.###.
+#..#.#..#.#
+#..#.##....
+
+....#.#
+####.##
+....#..
+...##..
+.##....
+......#
+.##....
+######.
+.##..#.
+#..#..#
+####.##
+.##...#
+.##...#
+####.##
+#..#..#
+.##..#.
+######.
+
+..##..##.....#...
+.##.#..###..#..#.
+###...###.#...##.
+#..#.###...#.###.
+#..#.###...#.###.
+###...###.#..###.
+.##.#..###..#..#.
+..##..##.....#...
+#..#..#.#.#.#.##.
+#.#..##.##..#.#.#
+##....####.####..
+##.###.#.#.#####.
+##.###.#.#.#####.
+
+##..##.
+#.#.##.
+#.#.##.
+##..##.
+###.#.#
+.#.#..#
+..#...#
+..##...
+.##...#
+.##.#.#
+.##.#.#
+.##.#.#
+..##...
+
+##########....##.
+##.#..#.###.#.##.
+...####...##..##.
+#.######.#.##....
+##.####.###.#...#
+##......##.#.#..#
+.#..##..#.##.#..#
+##..##..###.##..#
+#...##...########
+....##....####..#
+..######..#.##..#
+...#..#....#..##.
+.#.#..#.#.####..#
+
+.##..##
+#.#####
+..#.###
+#.###..
+####...
+#####..
+#.###..
+..#.###
+#.#####
+.##..##
+...#...
+
+.##...#..##.##.
+.#.#######..#..
+.##..##.##.#.##
+.##.##.#..###.#
+.##.##.#..###.#
+.##..##.##.#.##
+.#.#######..#..
+.##...#..##..#.
+..######.###...
+##.#.#.##.#..#.
+#.#...####.#...
+#.#...####.#...
+##.#.#.##.#..#.
+
+.##.##.##....
+....#.##.####
+....#.##.####
+.##.##.##....
+####.#.##....
+....#.###.#.#
+.#.#.###.....
+###.#....####
+.##.####..###
+.##.####..###
+###.#....####
+.#.#.###.....
+..#.#.###.#.#
+####.#.##....
+.##.##.##....
+
+#.##....#.#.#
+#..#.######..
+...##..###.##
+....#..###.##
+#..#.######..
+#.##....#.#.#
+.#.....#.##..
+....#.##..#.#
+....#.##..#.#
+.#.....#.##..
+#.##....#.#.#
+#..#.######..
+....#..###.##
+
+#.##...#.....
+.##.###.#..#.
+##..#.##..##.
+.#.#.#...####
+..#.###.##.#.
+###.##.####.#
+###.##.####.#
+..#.###.##.#.
+.#.#.#...####
+##..#.##..##.
+.##.###.#..#.
+#.##.#.#.....
+.#.###...#.##
+.....##.##.#.
+.....##.##.#.
+.#.###...#.##
+#.##.#.#.....
+
+#...###.#
+##.#..##.
+.##..#..#
+#....###.
+#....###.
+.##..#..#
+##.#..##.
+#...###..
+#...###..
+##.#..##.
+.##..#..#
+
+##.#..##..#.###
+###........###.
+###........###.
+##.#..##..#.###
+##.#..##..#..#.
+..##.####.##...
+..............#
+..##..##..##..#
+###........###.
+##....##....###
+####..##..#####
+#...##..##...#.
+#..##.##.##..#.
+
+####.##
+...#.##
+...#.##
+.###.##
+#.#....
+#..#...
+####.##
+.#..###
+##..###
+##.#.##
+..##.##
+
+###.###..###.##
+..############.
+...#..####..#..
+..#.########.#.
+....##.##.##...
+..##.##..##.##.
+##.#........#.#
+...#..####..#..
+##.#..####..#.#
+##.##......##.#
+##...#.##.#...#
+.....#.#..#....
+#####.#..#.####
+##.#.##..##.#.#
+##..########..#
+##..#.####.#..#
+....#.#..#.#...
+
+#.#.#.####.
+##...#.....
+.##......##
+.##......##
+##...#.....
+#.#.######.
+#....#.....
+##.########
+...##.....#
+.#.#.#.....
+.#.#.#.....
+
+##.###..#.#
+#..###..#.#
+.#...###.#.
+..##...#..#
+###.#..###.
+###.#..###.
+..##...#..#
+
+..#.#..
+..#.#..
+.##....
+.##..#.
+..#...#
+####.#.
+#.#....
+##.#...
+##.#...
+#.#....
+####.#.
+..#.#.#
+.##..#.
+
+###..##
+.##..#.
+#####..
+#####..
+.##..#.
+###..##
+..#####
+.#.####
+.#..###
+
+.#....##....#
+.#.##.##.##.#
+#.#..#..#..#.
+...##....##..
+##....##....#
+#.#..#..#..#.
+#............
+..###....###.
+###..####..##
+##....##....#
+..#..#..#..#.
+###..####..##
+##.##.##.##.#
+
+.........##.###
+.........##.###
+###.#.#..#....#
+......#...###.#
+#.#......##.##.
+.##.######...#.
+#######....####
+######.##.....#
+#.#...##..#####
+####..##..#..##
+##.######.#.#.#
+##...##..###...
+...#.....#.###.
+...#.......###.
+##...##..###...
+
+......#....#..#..
+..##......#....#.
+...#.###.########
+.....##.#........
+.##....#.........
+..###..##........
+..#.##...########
+###..##.#.#.##.#.
+###..##.#.######.
+
+....#...#.#..
+##...####...#
+#.##...#.##..
+#.##...#.##..
+##...####...#
+....#...#.#..
+##...#..#.#.#
+#.#.#.#..####
+#.#..##..##.#
+.####.#.#....
+###...##.##..
+###..###.##..
+.####.#.#....
+
+...####
+..#.##.
+....##.
+##....#
+##.##..
+##.##..
+##....#
+..#.##.
+..#.##.
+...####
+...###.
+..#..##
+..#.###
+##..#.#
+..##.#.
+##.#.##
+...#..#
+
+#....#...#.#.##.#
+##..##...###.#.##
+##..###...#......
+.####.#.##.##...#
+......#.#...##..#
+#....###.#.####.#
+.......##...#...#
+######.#.#...###.
+.#..#.##..##...#.
+.#..#..##...#...#
+.#..#..##...#.#.#
+
+.#.#..#
+.#.#..#
+#.##...
+#...##.
+.#.####
+.#..##.
+.#..##.
+####..#
+##.....
+
+#....#...
+.#...#..#
+.#...#..#
+#....#...
+.#....##.
+..#######
+..#####.#
+.#....##.
+#....#...
+
+.###..###
+.#.###.##
+#.#.#.###
+.##..##..
+#........
+#.#.##.##
+.####.###
+.##......
+.##..#.##
+#.###..##
+.####..##
+....##...
+###..##..
+.##..##..
+....##...
+
+..#..##
+..#..##
+..#...#
+#...###
+###.#.#
+#.#.#..
+.#.#.##
+.#.#.#.
+#.#.#..
+###.#.#
+#...###
+
+..####..##....##.
+........##....##.
+########.#....#.#
+.#....#.#.####.#.
+#.####.#........#
+##.....###....###
+##....##.##..##.#
+##....##.######.#
+##....###......##
+..####..#.#..#.#.
+##.##.##..#..#..#
+
+#....###.....###.
+#....###.....###.
+.##.#.#...#..####
+######.#..##...##
+..##..###...#.###
+..###..###....###
+.###.#.#.#..#.###
+.###.#.#.#..#.###
+..###..###....###
+..##..###...#.###
+######.#..##...##
+.##.#.#...#..####
+#....###.....##..
+
+#.###....#.#..#
+........###....
+........###....
+#.###....#.#..#
+.#.#..#.#.#...#
+....#.#...#....
+.#.#...#.#...##
+.....#.#.######
+###....##.###.#
+###....##..##.#
+.....#.#.######
+
+#..##..##
+.##..####
+#######..
+.....##..
+.##......
+....###..
+#####..##
+.......##
+##.#...##
+#..#..###
+.....####
+#####....
+#..#.....
+
+#.####.##.#
+#.####.##..
+###..##.#..
+..#.#..#..#
+##.#...#.#.
+#.###..##.#
+#.###...#..
+.#....##.##
+..##.##.#..
+##.##...###
+##.##...###
+..##.##.#..
+.#....##.##
+#.###...#..
+#.###..##.#
+
+.###..###....
+...#.#..#..##
+...##........
+...##........
+...#.#..#..##
+.###..###....
+#.#.#.#.#####
+......###.##.
+#.####...#...
+#.###.##.....
+#.....##...##
+.#..#.#...#..
+#..#.##.###..
+
+.#.#.##..#.#####.
+.#.#.##..#.#####.
+..##.#.###.#..##.
+#.####..#....###.
+#.#.##.##.####.#.
+.###..#...#..#..#
+.##...#...#..#..#
+#.#.##.##.####.#.
+#.####..#....###.
+
+####...
+....#..
+...##..
+#..#.##
+#..#..#
+....##.
+....##.
+
+###.#........
+###.#........
+.....###..###
+.#.##.##..##.
+.##...#.##.#.
+##..#..####..
+#..#.#.####.#
+#..####....#.
+#....#..##..#
+.#.###......#
+.#.#.#......#
+.#.####.##.##
+#.####.#..#.#
+......######.
+##.####.##.##
+..###.##..##.
+#####.######.
+
+.#.##..####..##
+#...#.#.##.#.#.
+#...#..####..#.
+#...#..####..#.
+#...#.#.##.#.#.
+.#.##..####..##
+#..#...####...#
+.###...####...#
+#.##..##..##..#
+#..##.##..##.##
+#.##.###..###.#
+..#...##..##...
+.#.#....##....#
+.##..#..##..#..
+##...#......#..
+.#....#....#...
+##.#....##.#..#
+
+#......######
+..####..#..##
+.##..##..#..#
+#..##..##.###
+#..##..##.###
+.##..##..#..#
+..####..#..##
+#......######
+.##..##.....#
+..#..#..##...
+##.##.##..##.
+....#....#.##
+.#.##.#.#....
+.#.##.#..###.
+.........##.#
+
+#######.##.##
+#.##.#.#.##..
+##..####.....
+..##....###.#
+##..###..#...
+#....#...#...
+......##.....
+
+#..####..#...
+...#..#....##
+....##.....##
+..#....#..#..
+....##......#
+..#....#..###
+##..##..##.#.
+..##..##.....
+...#..#...###
+###....###...
+............#
+..######...#.
+............#
+...####....#.
+############.
+
+.##.#####..
+##.....#.#.
+##..###.###
+..#.#.#...#
+###....#...
+###......#.
+.##......#.
+####..#####
+####..#####
+.##......#.
+###......#.
+
+##.....##.....###
+.####..##..####..
+#.#.#.####.#.#.##
+....##.##.##.....
+#####......######
+#..#..#..#..#..##
+#.####.##.####.##
+.###..#..#..###..
+#..###.##.###..##
+###.#..##..#.####
+#.#..#####...#.##
+#.#.#.#..#.#.#.##
+.##.#..##..#.##..
+
+###.##....#
+..#####..##
+..##.##..##
+###.##....#
+...#.......
+.#.#.#....#
+.#..#######
+##.##......
+###..#....#
+
+#.#..#..#
+.######..
+###..###.
+..#..#...
+#.####.#.
+#..##..#.
+#.#..#.##
+.#.##.#.#
+###..###.
+#.#..#.##
+#......##
+#......##
+#......##
+#......##
+#.#..#.##
+
+..##..####.#.#.
+..##..####.#.#.
+.#.#.##.##...##
+##.#....#.##..#
+...#...###.#.##
+..##.#.#.#...##
+..#.##..##..#.#
+##..#####.....#
+...##.##.##.#..
+...#.##.##.##.#
+####.#.####.#.#
+
+.####.#..
+.####.#..
+..#.###..
+.##.##.##
+..###.###
+###..#.#.
+.##....##
+##.#.#.#.
+##.#.#.#.
+.##....##
+###..#.#.
+...##.###
+.##.##.##
+..#.###..
+.####.#..
+
+..##...##
+.#..#.#.#
+#....###.
+######..#
+........#
+######.#.
+#.##.####
+..##.....
+##..##..#
+......##.
+.####.#.#
+######.##
+.#..#..##
+.#..#...#
+######.##
+
+##########..##...
+#..#..#..#....##.
+...#..#....##....
+....##....#.#..#.
+.##.##.##....#.##
+.##.##.##.##..###
+..........#..###.
+
+#####..#####.##.#
+#.##....##.#.....
+#...#..#...#..##.
+#.###..###.#.....
+.#..####..#.#####
+##..####..###.##.
+##...##...###.##.
+#..######..#.....
+#..######..#.####
+.#..####..#......
+...##..##...#.##.
+#.#.#..#.#.##....
+.###....###..#..#
+.##.#..#.##.#....
+#####..#####.....
+
+#.#.##.###.#...
+##.....#.##.###
+...#.##....#...
+#......####.###
+##.....####.###
+...#.##....#...
+##.....#.##.###
+#.#.##.###.#...
+#######..#...##
+.##.#..#.###...
+..#.#.#########
+
+#..##....####....
+#..##....###.....
+.###########.....
+...##.#.#....###.
+....##..#.#..#.##
+....##..#.#..#.##
+...##.#.#....###.
+.###########.....
+#..##....###.....
+#..##....####....
+.#.#.#..#.#......
+..#.####..##..#.#
+....#..##.#..#...
+
+##........###
+####....####.
+###.#..#.####
+..###..###..#
+..##....##..#
+.##########..
+###.#..#.####
+..###..###...
+..#..##..#..#
+
+#.##..##.#.#.#.
+.#..##..#.###.#
+.#..##..#.###.#
+#.##..##.#.###.
+#.######.###.##
+...#..#...#####
+#..#..#..##....
+#.##..##.#.#.#.
+..######..###.#
+
+#.######.##.#
+##..##...##..
+#....#.##..##
+.##....#....#
+..#....#....#
+#....#.##..##
+##..##...##..
+#.######.##.#
+#.##.###....#
+
+..##.##..
+####.#..#
+#.#...#..
+..#......
+.##......
+#.#...#..
+####.#..#
+..##.##..
+.###.#.##
+#..##....
+.###..###
+...####..
+#####.##.
+#..#.##.#
+#..#.##.#
+
+..#.#..######
+#..#..###.#..
+#..####.#..#.
+##..##.....##
+...###...#.##
+###.#....####
+######.##.#..
+.##.###.##.##
+.##.#.#######
+.#.#.#..##...
+.#.#####.####
+.#.#####.####
+.#.#.#..##...
+
+#...#..#...#.#.
+#...##.##..###.
+.##.#...##.#...
+.##.#...##.#...
+#...##.##..###.
+#...#..#...#.#.
+##.#...###.####
+...#.#.#.##....
+#.#...######.#.
+#..##...#####.#
+.###.#.###.#.##
+.###.#.###.#.##
+#..##...#####.#
+#.#...####.#.#.
+...#.#.#.##....
+##.#...###.####
+#...#..#...#.#.
+
+..##...#.#..###
+..##...#.###...
+.#..#....###.#.
+....#..#..#.###
+.......##.##.#.
+##..##...#.##..
+#######.#.##..#
+#######.#.##..#
+##..##...#.##..
+.......##.##.#.
+....#..#..#.###
+
+.##...#.#####
+.##.#.#.#.###
+###.#.#.#.###
+.##...#.#####
+....#..#..#..
+#######..##..
+###.....#.#..
+###...#.###..
+#.#..#.###...
+.###.#.#..#..
+#.##.##.#..##
+
+#...#..##.###
+#.#.#.##.#..#
+##.##..#..#..
+####.#..##.##
+...##.#.##.##
+##.#....#.#..
+#..##.#...#..
+#..#.##.#....
+..#........##
+..#........##
+#..#.##.#....
+
+######.#..##.##.#
+..#######.#...##.
+.#####.#.#.#...##
+#.##..#.######...
+.##..#..#.#..####
+.###..###..##...#
+#...######..#.###
+####.#.#..##..#.#
+####.#.#..##..#.#
+#...######..#.###
+.###..###..##...#
+.##..#..#.#..####
+#.##..########...
+.#####.#.#.#...##
+..#######.#...##.
+######.#..##.##.#
+######.#..##.##.#
+
+#.##..##.####
+..#.##.#.....
+###.##.######
+#.#....#.####
+#.##..##.####
+..#....#..##.
+.########.##.
+.###..###.##.
+#..####...##.
+#..#..#..#..#
+##......#####
+####..####..#
+..#.##.#.....
+..#.##.#..##.
+###.##.###..#
+..##..##..##.
+.###..###.##.
+
+##....###.#######
+##....###..######
+.##.#.##..###.#.#
+###..####.#.#####
+##.########..#.##
+#.##.##...#.#.##.
+.#...#.........#.
+.#...#.........#.
+#.##.##...#.#.##.
+##.########..#.##
+###..####.#.#####
+.##.#.##..###.#.#
+##....###..######
+##....###.#######
+.###..###########
+###..##..##..###.
+#.#....#..#.#.###
+
+#.##..#
+..#....
+.###..#
+#...##.
+.#.####
+.#.####
+#...##.
+.###..#
+..#....
+#.##..#
+#.#####
+#.###.#
+##.#..#
+
+.#.#.####.#.##.##
+...#.####.#.##.##
+....#....#...#.##
+#..##.##.###...#.
+#..##..#......#.#
+.###..#.##.#.####
+.#...#.##.##.##.#
+#..##.##.#..#..#.
+#.....##.#.######
+..##....#..#...##
+.....#.#...#....#
+.....#.#...#....#
+..##....#..#...##
+
+####..#
+...####
+.##....
+###....
+..#.##.
+###.##.
+###.##.
+..#.##.
+#.#....
+
+..#.#....#.#.
+##...#..#...#
+....#.##.....
+..#...##...#.
+..##########.
+###.##..##.##
+####......###
+..#........#.
+##.########.#
+
+#.#.##...####..#.
+.#####.###.#.####
+....###.##.......
+.###.#.#..##.#.#.
+##.#.###.##..###.
+##.#.###.##..###.
+.###.#.#..##.#.#.
+....###.##.#.....
+.#####.###.#.####
+#.#.##...####..#.
+.#..##.....####.#
+#.##...#.##..####
+#.##...#.##..####
+.#..##.....####.#
+#.#.##...####..#.
+
+..##..#.#..#.##
+..#.#..##..####
+##.#...###....#
+..####.#.#.#.##
+..####.#.#.#.##
+##.#...###....#
+..#.#...#..####
+..##..#.#..#.##
+.....##.#...#..
+####...##...###
+..#...##...####
+##.....#.#..###
+##...####..##..
+..##.#####.##.#
+##.#.##..#.#.##
+..##......#.#..
+....#..#.####..
+
+.#.####
+####.#.
+##.###.
+..##..#
+##..#.#
+...#.#.
+####..#
+####..#
+...#.#.
+
+##......#.....#..
+.#.###..##..#..#.
+....###.#.######.
+..##.###....#####
+##.#.#.##..######
+...#######.#..###
+..#...#.##.#..###
+..#...#.##.#..###
+...#######.#..###
+
+.##.###
+.#..###
+.##.#..
+###.#.#
+.#.#..#
+#.####.
+##..#.#
+#.###.#
+######.
+#.####.
+#....#.
+#....#.
+#.####.
+
+##..##..##..###
+#....#..#....##
+..#.#.##.#.#...
+#####.##..#####
+###.##..##.####
+#.....##.....##
+#####.##.######
+
+.#..##.#..#
+####.##.##.
+...##.#.##.
+#.#....##..
+##..#######
+.#.#..#..##
+.#.#..#.###
+.........#.
+##..#......
+##..#......
+.........#.
+.#.#..#.###
+.#.#..#..##
+
+.##..#.##........
+##..##....##..##.
+##.###....##..##.
+.##..#.##........
+.###..##.###..###
+...##..#...####..
+##.#.##.#.#....#.
+#####..##..#..#..
+...##.###.#.##.#.
+##.#...###.####.#
+.#..##.#...#..#..
+....####....##...
+...#..##.###..###
+
+#..######.##.##
+....#..###..###
+....#..###..###
+#..######.##.##
+##.###..######.
+#......#.#..#.#
+.#.#.##########
+##.###.#......#
+####.####.##.##
+#...##..#######
+#...#.####..###
+
+.#......#.#
+..#.##.#..#
+#..#..#..#.
+.##.##.##..
+.#......#..
+##......###
+.#.#..#.#..
+....##....#
+##......###
+#..#..#..#.
+#..####..##
+..........#
+##.#######.
+..#.##.#..#
+..#.##.#..#
+
+..######..###
+###....####..
+####..####...
+.#.####.#...#
+#.#....#.#...
+#........#...
+#........#...
+##......##...
+#........#...
+
+.#..####...##.##.
+##.#.#.#...#.##.#
+####.##..#.##..##
+#.....#.#..##.##.
+#####.#####.####.
+#####.#####.####.
+#.....#.#..##.##.
+####.##..#.##..##
+##.#.#.#...#.##.#
+.#..####...#####.
+.#.##..###.#..#..
+#..#.#..#....#.#.
+#.##..####..#.##.
+##..##.#.###.#.##
+##..##.#.###.#.##
+#.##..####..#.##.
+#..#.#..#....#.#.
+
+...#.##..####
+.#.#...#..#.#
+#.#########.#
+#.#..##..#...
+####..#.###.#
+####....###.#
+#.#..##..#...
+#.#########.#
+.#.#...#..#.#
+...#.##..####
+......#..#..#
+......#..#..#
+...#.##..####
+
+.....##..##......
+...##.....###...#
+#.#.########.#.#.
+.####..##..####.#
+#####.####.#####.
+#####.####.#####.
+.####..##..####.#
+
+#..#..##..#
+....#....#.
+#..#..##..#
+.....####..
+.##........
+.....####..
+....######.
+.##.##..##.
+#....#..#..
+....##..##.
+.##.#....#.
+
+...##....#.##..##
+#...#.#..##......
+.##.##..#...##...
+.###.#.....#.#...
+##.#...#.#.##.#.#
+##.#...#.#.##.#.#
+.###.#.....#.#...
+.##.##..#...##...
+#...#.#..##......
+...##....#.##..##
+.#...#.#.#.###...
+...#.###..#....##
+...#.####.#....##
+
+##.##..###.#.
+##.##..###.#.
+..##..#......
+#..##.#######
+###.##.#....#
+..#.###..##..
+#.#.#.#......
+.....####..##
+.....####.###
+#.#.#.#......
+..#.###..##..
+
+###..##
+###..##
+.#.#.##
+.##.#.#
+##..###
+.#..###
+..#.#..
+.####..
+.##..##
+.##.#..
+#.###..
+
+#......####.##.##
+..##.##..###..###
+..##..#..###..###
+#......####.##.##
+#..###.###......#
+..#.#...####..###
+..#..#####.#..#.#
+.##.#.#..##....##
+...#.####..#..#..
+##.#..#.#..####..
+#.#.#.#.##......#
+
+.##.#####.##...
+.#.#.##..###.##
+.#.#.##..###.##
+.##.########...
+###.##.#.##.###
+#####..#.#...##
+....##...#.####
+.##.##.#.#.####
+#.#..#######.##
+
+###..###..##.
+..####..#....
+#.#..#.#.####
+#.#..#.###..#
+###..########
+#.####.#####.
+##.##.##.....
+.##..##.#....
+#.#..#.##....
+.#....#......
+.#....#.#.##.
+
+#..#.##.#..####..
+.#........#.#..#.
+.####..####..##..
+###.#..#.#####.##
+#..........###...
+#..........###...
+###.#..#.#####.##
+.####..####..##..
+.#........#.#..#.
+#..#.##.#..####..
+#.#..##.##.####.#
+
+##.###..##.
+##.##...##.
+..##....#.#
+###.####.##
+...####.###
+###.##.#.#.
+##.###.#...
+
+###.#####..
+#######...#
+##..##.##.#
+.#..#..#.#.
+..##..#.#..
+#.##.#..##.
+##..##.#...
+........#..
+#.##.######
+.####....#.
+######....#
+######....#
+.####....#.
+
+#..###.#.
+###..##..
+...#.##.#
+#..#..###
+#..#..###
+...#.##.#
+###..##..
+#..###.#.
+.#.#####.
+#..##.#..
+.#.#.#...
+.#.#.#.##
+###.#..##
+##...##.#
+.#...##.#
+
+....###.##.
+.##..#####.
+....#...#.#
+.##.....##.
+.....###..#
+......#.###
+......#.###
+.....###..#
+.##.....##.
+....#...#.#
+.##..####..
+....###.##.
+#..##.#....
+#####.#.###
+.##.#####..
+.....#..#..
+.##.#..#..#
+
+.#.##.#..#.##.#.#
+#.####....####.##
+###..######..####
+#.....##.#.....#.
+#....#.##.#....#.
+####.######.####.
+...####..####...#
+#...#.####.#...##
+#...#.####.#...##
+...####..####...#
+####.######.####.
+
+###..#..#..######
+#.#...##...#.##.#
+##..#.##.#..####.
+...##....##......
+#.##.#..#.##.##.#
+####..##..#######
+#.#.##..##.#.##.#
+#.####..####.##.#
+##.###..###.####.
+.###......###..##
+#.#..####..#.####
+##..#....#..####.
+.#.#.#..#.#.#..#.
+###..#..#..######
+.##.#.##.#.##..##
+#.#.#....#.#.##.#
+#..#..##..#..##..
+
+.#..##..#.#..#.#.
+.#..##..#......#.
+#..###...##..##..
+.##.##.##..##..##
+.#.####.#..##..#.
+..#....#..#..#..#
+.##.##.##.#..#.##
+#.#.##.#.#.##.#.#
+###....##########
+##.#..#.###..###.
+...#..#...#..#...
+#.##..##.#....#.#
+.##.##.##.#..#.##
diff --git a/2023/in/day13.ref b/2023/in/day13.ref
new file mode 100644
index 0000000..3b6b5cc
--- /dev/null
+++ b/2023/in/day13.ref
@@ -0,0 +1,15 @@
+#.##..##.
+..#.##.#.
+##......#
+##......#
+..#.##.#.
+..##..##.
+#.#.##.#.
+
+#...##..#
+#....#..#
+..##..###
+#####.##.
+#####.##.
+..##..###
+#....#..#