From 9251fe9084a3896c57f9b066eaa5b1776c9c985d Mon Sep 17 00:00:00 2001 From: nottu Date: Tue, 12 Dec 2023 22:14:28 -0800 Subject: [PATCH] day13 --- src/bin/day13.rs | 133 ++++ src/bin/day13/input.txt | 1407 ++++++++++++++++++++++++++++++++++ src/bin/day13/test_input.txt | 15 + 3 files changed, 1555 insertions(+) create mode 100644 src/bin/day13.rs create mode 100644 src/bin/day13/input.txt create mode 100644 src/bin/day13/test_input.txt diff --git a/src/bin/day13.rs b/src/bin/day13.rs new file mode 100644 index 0000000..bf9f706 --- /dev/null +++ b/src/bin/day13.rs @@ -0,0 +1,133 @@ +fn main() { + let input = include_str!("day13/input.txt"); + dbg!(part1(input)); + let input = include_str!("day13/input.txt"); + dbg!(part2(input)); +} + +#[test] +fn day13_test_part1() { + let input = include_str!("day13/test_input.txt"); + assert_eq!(part1(input), "405"); +} + +fn part1(input: &str) -> String { + let maps = parse_maps(input); + maps.iter() + .map(|map| map_summary(map, 0)) + .sum::() + .to_string() +} + +#[test] +fn day13_test_part2() { + let input = include_str!("day13/test_input.txt"); + assert_eq!(part2(input), "400"); +} + +fn part2(input: &str) -> String { + let maps = parse_maps(input); + maps.iter() + .map(|map| map_summary(map, 1)) + .sum::() + .to_string() +} + +fn map_summary(map: &[Vec], max_smudges: usize) -> usize { + let vert = find_vertical_reflection(map, max_smudges); + let hori = find_horizontal_reflection(map, max_smudges); + if hori.is_some() && vert.is_some() { + panic!("two relfections?") + } + if hori.is_none() && vert.is_none() { + panic!("no reflections?") + } + vert.unwrap_or(0) + hori.unwrap_or(0) * 100 +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +enum Tile { + Rock, + Ash, +} + +impl From for Tile { + fn from(value: char) -> Self { + match value { + '.' => Self::Ash, + '#' => Self::Rock, + _ => unreachable!(), + } + } +} + +fn parse_maps(input: &str) -> Vec>> { + let input = input.lines(); + + let mut maps = Vec::new(); + // Vec> + let mut curr_map = Vec::new(); + + for line in input { + if line.is_empty() { + maps.push(curr_map); + curr_map = Vec::new(); + } else { + curr_map.push(line.chars().map(Tile::from).collect::>()); + } + } + if !curr_map.is_empty() { + maps.push(curr_map); + } + maps +} + +fn find_vertical_reflection(map: &[Vec], max_smudges: usize) -> Option { + // dbg!(map.len()); + // let map_rows = map[0].len(); + // dbg!(map_rows); + (1..(map[0].len())).find(|&idx| has_vertical_reflection(map, idx, max_smudges)) +} + +fn find_horizontal_reflection(map: &[Vec], max_smudges: usize) -> Option { + (1..(map.len())).find(|&idx| has_horizontal_reflection(map, idx, max_smudges)) +} + +fn has_vertical_reflection(map: &[Vec], idx: usize, max_smudges: usize) -> bool { + let mut left_idx = idx; + let mut right_idx = idx; + let mut smudge_count = 0; + + while left_idx > 0 && right_idx < map[0].len() { + left_idx -= 1; + for (_row_idx, row) in map.iter().enumerate() { + if row[left_idx] != row[right_idx] { + smudge_count += 1; + if smudge_count > max_smudges { + return false; + } + } + } + right_idx += 1; + } + smudge_count == max_smudges +} + +fn has_horizontal_reflection(map: &[Vec], idx: usize, max_smudges: usize) -> bool { + let mut left_idx = idx; + let mut right_idx = idx; + let mut smudge_count = 0; + while left_idx > 0 && right_idx < map.len() { + left_idx -= 1; + for x in 0..map[0].len() { + if map[left_idx][x] != map[right_idx][x] { + smudge_count += 1; + if smudge_count > max_smudges { + return false; + } + } + } + right_idx += 1; + } + smudge_count == max_smudges +} diff --git a/src/bin/day13/input.txt b/src/bin/day13/input.txt new file mode 100644 index 0000000..54d6dec --- /dev/null +++ b/src/bin/day13/input.txt @@ -0,0 +1,1407 @@ +.#.#### +##..#.# +##..#.# +.#.#### +..#..#. +####.#. +#.#.#.# +.#..#.# +##.##.. +#.#..#. +#.#.... + +.##.....#....#. +.##.....#....#. +..#.#..##....## +...###...#..#.. +#..##.....##... +.#.#...#.####.# +#.#.....######. +##..###...##... +#..#..##..##..# +.##.#.#........ +#..#..##..##..# +#####.#.##.###. +.#....##.#..#.# +..##.#...#..#.. +#..####..#..#.. + +.##......## +.##......## +.#.#.##.#.# +#.########. +#.##....##. +#.######.#. +####....### +##.#.##.#.# +###......## +...######.. +####.##.### + +....#.### +#.#..#### +##....... +##....... +#.#..#### +....#.### +#..##.#.# +#.##...#. +#.##..#.# +####..#.. +#.#.###.# +#.#..##.# +####..#.. +#.##..#.# +#.##...#. + +##.####.# +.###.#### +###...### +###...### +.###.#### +#..####.# +..###..#. +##..#..#. +####...#. +#....#.#. +...#..... +#....#.## +#.#.#.##. +#.#.#.##. +#....#.## +...#..... +#....#.#. + +.##..#..#..#..# +#....##.##.##.# +......#..###### +......#..###### +#....##.##.##.# +.##..#..#..#..# +######..#.#.### +.#..#.....#.#.. +#...#..#.#.##.# +.###....#..###. +.###....#..###. +#...#..#.#.##.# +.#..#.....#.#.. +######..#.#.### +.#...#..#..#..# + +.######.#.#..#. +#..##....##..## +#.#.#.###.#..#. +#.#.#.###.#..#. +#..##....##..## +.######...#..#. +#.#.#..#..####. +#.#...######### +.....###.##..## +.#.#....###..## +.#...#...#....# + +#.##.#......#.# +#.##.#......#.# +..##.#.......#. +.##.##.##.##... +#.#.##...#.#### +##...#.##.#.##. +.#..#.##.#.#..# +.#..#.##.#.#..# +##...#.##.#.##. +#...##...#.#### +.##.##.##.##... +..##.#.......#. +#.##.#......#.# + +..#..#..#..#. +##.#.####.#.# +####......### +#####.##.#### +..#.#.##.#.#. +####..##..### +...#......#.. +##.###..###.. +...#..##..#.. +##.##.##.##.# +##.###..###.# +####......### +..#.##..##.#. +##..........# +##.##....##.# + +.#.#....#.#...... +...##..##.......# +#..######..#.##.. +.###....###.##... +.#.#.##.#.#..#... +..###..###....... +###..##..####.### +#..##..##..##.#.. +....#.##....#...# +###.#..#.###.#.#. +#.#......#.##..#. +#.#......#.##..#. +###.#..#.###.#.#. + +#.##..##...##.. +##.#.#.####..## +##..#..#.#.##.# +##.###.##...... +####...####..## +##.#.#.####..## +##.#.#.####..## +####...####..## +##.###.##...... +##..#..#.#.##.# +##.#.#.####..## +#.##..##...##.. +#...#.######### +.##.###.#.#..#. +......####.#### + +##..##. +.##.... +.##.... +##..##. +#.###.# +#.##..# +.###### +.###### +#.##..# +#.###.# +.#..##. + +....#.. +##.#.## +..#.#.. +....### +##.#.## +##.#### +###.... +##.##.. +....#.. +.....## +#####.. +##..... +....#.# +####.## +##..#.. + +.#.##.#.....#.#.# +###..###.#####... +###..###.#####... +.#.##.#.....#.#.# +.#....#..#.###... +#.#..#.#####..##. +#.####.##......#. +##.##.##.##.##..# +###...##.##....## +#.####.#####.#### +##.##.##.##...... +#########.#.####. +###..####..###... + +#..####..#..#..## +###.##.####.#.##. +..######.....#.## +###.##.#####...#. +#.#....#.#.#....# +##.####.###.#.#.. +###....###.#.#.## +###.##.####.##### +...#..#....##...# +...#..#....##...# +###.##.####.##### +###....###.#.#.## +##.####.###.###.. +#.#....#.#.#....# +###.##.#####...#. + +####..##. +####...## +.....###. +...###### +######... +....#.... +####..#.# +####..#.# +....#.... +######... +...####.# +.....###. +####...## + +#...#..#. +#...#..#. +####....# +#..###### +...###### +###...... +...##..## +###.####. +#.#....#. + +.####.. +##.#.#. +##.#.#. +.####.. +#..#..# +.....## +.#.#..# +..#.#.# +..#.#.# +.#.#..# +.....## +#..#..# +.#.##.. + +#.#.#....##.. +.####.#.####. +.####.#..###. +#.#.#....##.. +..#...###.... +..#...###.... +#.#.#....##.. +.####.#..###. +.####.#.####. +#.#.#....##.. +##.#.####...# +..#..#..#.##. +##.#######..# +.##..####...# +###..##....## +.######.##... +.#..#.##..##. + +......# +##...#. +.#....# +.#....# +.#...#. +......# +#..###. +...#..# +#.#..## +#.#...# +#..##.# +#..##.# +#.#...# +#.#..## +...#..# +#..###. +......# + +##..#.#.... +####..#.##. +#.#.#..#### +..#....#..# +..#....#..# +#.#.#..#### +####..#.##. +##..#.#.... +####...###. +#....###### +#...###...# +..#####..#. +..##.###.#. +..##.###.#. +..###.#..#. + +..........#.### +..######...##.# +.#......#...... +#.##..##.#..... +##.####.##.#.## +#...##...###..# +#...##...###..# +##.####.##.#.## +#.##..##.#..#.. + +..#.......##.#. +#.#.#...####..# +.#..##.#.#.#.## +.#..##.#.#.#.## +#.#.#...####..# +..#.......##.#. +..#..#####....# +.#.#.#......### +.#.###......### + +...#.##.# +....#..#. +#..##..## +...###### +.#.#....# +.#.#....# +...###### +#..##..## +....#..#. +#..#.##.# +###..##.. + +.#.####.#.... +#.#....#.#... +###....##.### +#.##..##.#.## +.#.#..#.#.### +#.######.#... +#.##..##.#### + +##.#.## +#...... +#...#.# +####.## +.#.#..# +...#### +...#### +.#.#..# +####.## +#...#.# +#...... +##.#.## +.#..#.. +#..#..# +#.....# + +#.########.#. +..##....##..# +..##....##..# +#.########.#. +.##..##..##.# +#.##....##.#. +.#.....#..#.# +...#.##.#.... +#..........#. +.#...##...#.. +.##.#..#.##.. + +.##..#..#.##.#. +#..#.##...##... +#######..####.. +#######..####.. +#..#.##...##... +.##..#..#.##.#. +.#.....#.#....# +......###.#..## +.......#.###.#. +####.##..#..#.# +....#.#.##.#..# +######.######.. +....#..##.###.. + +##.#....#.. +##.#...##.. +.###.##.#.# +##.####.... +...##....#. +..#....#.#. +.....##..## +.#..####... +.#..####... +.....##..## +..#....#.#. +...##....#. +##.####.... +.###.##.#.# +##.#...##.. + +##.####.# +.#.####.# +.#.####.# +##..##..# +####..### +##.####.# +#.#....#. + +...#..##. +......##. +#...##### +#..#.#### +...###### +.#.###### +##...#..# +###..#### +##..#.... + +###..###. +####.#.#. +..#..##.# +###.#...# +......##. +..###.### +..#...### +##..#.#.# +##....... +..#...... +######... +#####...# +##..##.## +###....#. +###.#.### +#####..## +#####.### + +..#..###... +..#...##... +##..###.##. +#.#..###..# +.####...##. +#.###.#.### +..##.....## +#.#..##.#.# +######.#.#. +.####..#..# +.##.##..... +..#......## +..#......## + +..#...##...#..# +..####..####... +.#.#.#..#.#.#.. +###.#.##.#.###. +..##.####.##... +#..###..###..#. +#....####....#. +..#.######.#... +..#.######.#... +#....####....#. +#..###..###..#. +..##.####.##... +###.#.##.#.###. +.#.#.#..#.#.#.. +..####..####..# +..#...##...#..# +##.##.##.##.##. + +.###..#.# +..#...#.# +##.####.. +#..#.#### +....##... +....##... +#..#.#### +#..####.. +..#...#.# +.###..#.# +.###..#.# + +#..##..##...##... +........######### +##....########### +#.#..#.#.#.#..#.# +.##..##..##....## +###..############ +#########...##... +.#.##.#.######### +..#..#..###....## +###..#####.#..#.# +.#.##.#..######.# +..#..#..#..#..#.. +..####..##..##..# +#.####.########## +##.##.##.#.####.# +..####..#..#..#.. +########...####.. + +..#.#....#.#..##. +###.###.##.###..# +##.#......#.##..# +#....####....#..# +.##.#....#.##.##. +.#....##....#.##. +....######....... +#....#..#....#..# +##.#.#..#.#.##### +#.#...##...#.#### +#.##.####.##.#..# +#####.##.######## +.##..#..#..##.##. +.###......###.... +#..#.#..#.#..#..# + +#.#.#.#.#.####. +...########..## +..#.###.###..## +..#.#.#.###..## +#...#..#...##.. +.##..########## +#..#.....##..## + +#.###..##.#...... +#.###..##.#...... +.#.#...#....#..#. +#.#####..###..... +#####......#.###. +....#.###.#...### +....##.#.#.##..#. +#.##.#...#...##.# +..##..#.######### +#.#..###.#..###.# +#.#..###.#..##### +..##..#.######### +#.##.#...#...##.# +....##.#.#.##..#. +....#.###.#...### +#####......#.###. +#.#####..###..... + +......# +....#.# +#..#.#. +.#.#### +.#.#### +#..#.#. +....#.# +......# +.####.# + +....#.##.##..##.. +####..#.##.#.##.# +.#.....#.###....# +###.####......... +#.##.#.#..###..## +##.#.####.####### +####.##.#....##.. +#######.#....##.. +##.#.####.####### +#.##.#.#..###..## +###.####......... + +###..#...##...#.. +..#.####.##.####. +##.#..#......#..# +..#..#........#.. +###.#.########.#. +##.#...######...# +###.############. +##.#.#..####..#.# +##..#.#.####.#.#. +..#...#..##..#... +###.#####..#####. +#.#.###.####.###. +##..###.####.###. + +##.##.####..##.## +###..####..#..#.. +#.####.##..##.#.. +..####..#..#...#. +##.##.##....#...# +#.#..#.####.#.#.. +............#...# +#..##..#...#..##. +#......#.##...##. +.#.##.#.###.##..# +##.##.####.####.# +##.##.####.####.# +.#.##.#.###.##..# +#......#.##...##. +#..##..#...##.##. +............#...# +#.#..#.####.#.#.. + +.##..###.####..#. +.###...####.###.. +##...#..##.#.###. +##.##.#.##.##.#.# +##.##...##.##.#.# +#.##...#..##.##.. +.###....#####.#.. +..####.#..#..###. +..####.#..#..###. +.###....#####.#.. +#.##...#..##.##.. +##.##...##.##.#.# +##.##.#.##.##.#.# + +##.##..###. +##.##.#..#. +......#...# +......#...# +##.##.#..#. +##.##..###. +###....#.#. +#.#..#..#.. +#.##...#.#. +..####.###. +..####.##.. +#.##...#.#. +#.#..#..#.. +###....#.#. +##.##..###. +##.##.#..#. +......#...# + +###.############. +...#.#.######.#.# +##.......##...... +##.....#....#.... +####....####....# +..##.##.#..#.##.# +...######..###### +####.##..##..##.# +#...##..#..#..##. +..#.#.#..##..#.#. +.....#.#....#.#.. +#####..#.##.#..## +...#..##....##..# +####...#.##.#...# +###.#..#....#..#. + +....##..#.#.. +....#...##### +....#...#.### +.##..#...#... +....###.####. +#..##.#.##... +####..#####.. +#####..#.##.. +####...##.... +#####.#...### +#..###.####.. +.##.####..### +####.###..### +....#...#.... +.##...####### + +...###### +#.#..##.. +.#.###### +#...##### +..####### +#####..## +#.#.####. +.#...##.. +.#..#..#. +#...#..#. +.###.##.# +..##.##.# +..##.##.# +.###.##.# +#...#..#. + +##...#. +##...#. +.###### +###...# +.#.#.#. +...#.#. +#..#.## +#..#.## +...#.#. +.#.#.#. +##....# +.###### +##...#. + +##..#..## +##.#..... +##...##.. +#.###.... +###..#.## +#####.### +##.####.. +#####.### +....#.### +..##...## +..####... +..###.... +...###### +#######.. +###..#... + +####....##### +#####...#.##. +......#.##..# +....####.#### +....##...#..# +#..#.#....#.. +.....#...#..# +########..... +#######.#.##. +#..##..#.#..# +#..##.....##. +.....##.#.##. +.##.#.#.#.##. +########.#### +#..#...#..##. + +.#####.#.## +.#####.#.## +...#......# +.#.#..###.# +###.###.#.# +###..#...## +##.#####... +##..##..#.# +..##.####.# +#.#.#..#### +#.#.#..#### +..##.####.# +##..##..#.# +##.#####... +###..#...## +##..###.#.# +.#.#..###.# + +##......##### +#..#..#..##.# +#.#.##.#.#### +##..##..##..# +..#....#...## +###########.. +..######..##. +#.....#..#..# +.##....##..## +###.##.###... +#........#..# +##..##..###.. +##..##..###.. + +#.#..#.#..#.#.. +#.##.#.#..#.#.# +#.##.#.#..#.#.# +#.#..#.#..#.#.. +...#...#..#...# +...##..#..#..## +..#...#....#... +.##.#.######.#. +.....#......#.. +#######....#### +#.#.###.##.###. +##...#......#.. +#.##.#.####.#.# +#.###..#..#..## +###..##....##.. +#.###..#..##.## +#.#.....##..... + +...#.#..#.#...... +##..#....#..####. +#####....######## +##.#......#.####. +#.#...##...#.##.# +##..........####. +#.##########.##.# +.#####..#.###..## +.############..## + +..#.##..# +..#.##..# +.###..#.. +##.#..##. +#...#.#.. +###.#..#. +##.#.#### +..#...#.. +##.#....# +..###.#.. +#.#.###.# +.#.#####. +...#....# +...#....# +.#.#####. +#.#.###.# +..###.#.# + +..#...#.# +.#....#.# +#..#####. +..#####.. +...##...# +#.##..... +#.##..... +...##...# +#.#####.. +#..#####. +.#....#.# +..#...#.# +.#..#.##. +.#..#.##. +..#...#.# + +.#.####.##.#### +##.....#..##### +#.#.#......#### +##.#.#.#..##### +.#.########.##. +#.....##....##. +.#..#....##.##. +#..#.#....##.## +##.###.####.##. +##.##....#..... +#.##.##.####..# +.##..###.#..... +.##..###.#..... + +......#..#. +.......#..# +.......#..# +......#.... +######.#### +#.##.##.... +#######.##. +######.#..# +######..#.. +#########.. +......####. +#.##.###... +######.#.## +##..##.#... +#######.... +..##...#### +.......##.. + +.##.#####..#. +##.#..#.#.... +.#.###.##.#.# +##.###.....#. +..#..#.###..# +##..#.#....## +##..#.#....## +..#..#.###..# +##.###.....#. +.#.###.##.#.# +##.#..#.#.... +.##..####..#. +.##..####..#. + +#...#..##.#.#.. +#.#..##.####.#. +#.#..##.####.#. +#...#..##.#.#.. +.#.#...#..###.# +......#.....### +....##..#.##### +##...####.#.##. +#...#...##..### +...###.##..##.# +...##..##..##.# + +###..####.. +###..####.. +##....#.... +.####.###.. +###.###.#.. +##.###..### +....#.#..## +#.#..#..#.. +..#...##### +.#.####.... +##......##. + +##.##.#.#.. +###.#..##.. +..##.##.##. +#.#..#.#.## +#.###....#. +#..#.#...## +...##.###.# +...##.###.# +#..#.#....# +#.###....#. +#.#..#.#.## +..##.##.##. +###.#..##.. +##.##.#.#.. +.###.#..##. +#.####..#.# +#.####..#.# + +####....####... +...#....#...#.. +..##....##..... +...##..##....## +....####....#.. +#...####...#... +.#...##...#.### +.#........#.... +.....##........ +#..........#... +.#.#.##.#.#.### +##..#..#.###.## +.##......##..## +###.#..#.###.## +#...####...#... +..##....##..### +#.#.####.#.#... + +####..#.. +....####. +......##. +.##...### +.##...### +......#.. +....####. +####..#.. +.##.##.#. +.##..#.#. +#######.# +....###.# +######..# + +#.##.#..#.. +#.##.##.#.. +#.##.##.#.. +..##....#.. +..##...#.#. +#....###.## +..##...##.# +.#..#..##.# +#.##.##...# + +.#.########.#.. +####.......###. +#.###.##.###.## +..#........#..# +...##....##.... +###..#..#..###. +##.########.### +##.########.### +###..#..#..###. + +...##.....# +.##..##.... +..####..##. +#..##..#.## +#..##..#.#. +###..####.. +.#..#.#.### +.##..##.#.# +##....##### +..#..#....# +##....##..# +.#.##.#.### +...##...##. +##....###.. +##....###.. +...##...##. +.#.##.#.### + +#....######.# +#.##.#..#.#.# +.####.#...##. +#######.##... +##..#####.#.. +......###...# +......###...# +##..##.##.#.. +#######.##... +.####.#...##. +#.##.#..#.#.# +#....######.# +..##..###.#.. + +..####...##.. +.##..##..##.. +#.#..#.#....# +##....##....# +#.#..#.##..## +#.####.#.##.# +##.##..#.##.# +########....# +...##...####. + +##..... +..#.##. +###.### +.#.#### +.###..# +.###..# +.#.#### + +#....####.### +#....####.### +.#..#...##.## +#.##.#...#### +.#..##..#.... +.#..#.#...#.. +.####...##... +#.##.#.#.#.#. +..##...#####. +##..##.##.##. +#....###.#..# +.#..#.#..##.# +.......#.#... +.#..#.#.####. +......#..#... +##..##..##.#. +.#..#..#.###. + +#.#######.#.#.. +..#.#...#...#.. +#......#...#.## +##..##....###.. +.#.##.###.##### +###..#.#..##... +###..#.#...#... +##.#.##.##..### +.####.##..#..#. +..#####...##.## +..#####...##.## +.####.##..#..#. +##.#.##.##..### +###..#.#...#... +###..#.#..##... + +##.##.##.###.#..# +##.###.#..##..##. +.###..#.##..###.# +#.#...##.#####..# +..#.#.....#..#### +#...#.#..####.##. +#.#...####.#.#### +..#.#.#..##.#.##. +....##..##..##### +.#..##...#.###..# +.##.#..#..#.##..# +.##.#..#..#.##..# +.#..##...#.###..# +....##..##..##### +..#.#.#..##.#.##. + +####... +#.##### +..##### +####... +#....## +.###.## +.#..#.. +###.### +##...## +.###.## +#.##### + +..######... +.#......#.. +#....#...#. +##......### +.##....##.# +...####...# +.#.#..#.#.# +.#..##..#.. +#........#. +#.#.##.#.## +.#.####.#.# +.#.#..#.#.. +.#.####.#.. +.#.####.#.. +.#.#..#.#.. + +##.#......#.##. +##.#......#.##. +####......##### +###..#..#..###. +...#......#...# +#...#.##.#...#. +##....##....##. +##.###..###.##. +.###......##..# +...########.... +###.#....#.###. +..###....###..# +#.#.#.##.#.#.#. + +.######.######.## +.#.##.#...##...#. +##....####..####. +.##..##........## +#.#..#.#.####.#.# +##.##.###....###. +.#....#.#....#.#. +.#.##.#.#....#.#. +..#..#..######..# +########..##.#### +...##............ +#.####.#......#.# +..#..#..######..# + +.#.##...... +...##...... +..#..##.#.. +..#.#..###. +....#...#.. +#.#..##..## +...##.#.### +..#.###..#. +..#.###..#. +...##.#.### +#.#..##..## +....#...#.. +..#.#..###. + +#..#.####.#..## +#..###..###..#. +#.#.#.##.#.#.## +##..#.##.#..### +.##.##..#..##.. +..#..#..#..#... +##..#....#..### +.##.#....#.##.# +...#..##..#...# +....#....#....# +.....#..#...... +..#.#....#.#... +..##......##... +..##......##... +..#.#....#.#... +.....#..#...... +....#....#....# + +.##..#. +.##..#. +#.#.### +..##... +.#...#. +#####.. +#.#.### +#.#.### +#####.. +.#...#. +...#... + +###..#..### +.....#...## +......#.#.. +..#.#...#.. +...###.#### +##.##...##. +..###...### +##...#.#..# +#.##.##..#. +..#...#.#.. +...#.#..#.. +...#.#..#.. +..#...#.#.. + +.....##.. +....#..#. +.....##.. +#..#.##.# +####....# +.##...... +#..###.## + +.#..##.###### +#.#..##.#.##. +#.#..##.#.##. +.#..##.###### +.####..#..... +.#.#.#.#.#..# +####...#...#. + +#..#... +...#... +.###.#. +..#.##. +..#.#.# +.##.##. +.##.##. +..#.#.# +..#.##. +.###.#. +...#... +#..#... +...###. +#....## +.###### + +.##...#.# +####....# +...####.# +#..#.#### +.##.##.## +#####.#.# +....##### +.##.##.#. +.##..##.# +#..#.#### +.##...##. +#..#..### +#..#..### + +..#...# +..#...# +.###### +.##.#.# +.#.#.#. +#...##. +......# +#...#.# +#...#.# +......# +#...##. +.#.#.#. +.##...# +.###### +..#...# + +###.##. +..##... +.#.#..# +.#.#... +..##... +###.##. +###...# +.#..... +#...#.# +...##.# +...##.# +#...#.# +.#..... +###...# +###.##. + +....#..#. +##.###### +##.#....# +..###..## +..#..##.# +.....##.. +##.#.##.# +..##.##.# +###..##.. + +###..##.##.#. +###..##.##.## +######.#.#.## +####.#..#.#.# +...#.#.##.### +##..##.#..... +....##.#..##. +........#.#.. +...#....#.##. +###.####..... +...##...#.### +####..#.###.. +....#..#..##. +##.####...#.# +...#.......#. + +..#.#.. +..##### +..##### +..#.#.. +##..#.. +...#.## +.###### +.###..# +.####.# +.###### +...#.## + +.####..####.#..## +##..#..#..###.#.. +#...#..#...#.#.## +.#.##..##.#.##..# +#..#.##.#..#..... +.#..#..#..#...... +.#.######.#..#... +##.##..##.##.#... +.###....###.##### + +..###..#.##.. +..###..#.#... +...#.#..##### +#####.###.#.# +...#.#..#.#.# +#####..###.#. +##.....##.#.. + +....##. +.#.#### +.###### +.#.#..# +#.##..# +...#### +.###### +#...##. +##..##. +#...##. +#...##. +.###### +...#### + +##....##. +##...##.. +##.####.# +..##..##. +..##..##. +##.##.#.# +##...##.. +##....##. +....##.## +..#...### +...##.##. +...#...## +#####..#. + +##.#.#. +#..#.#. +..#...# +##.#... +...#... +.###... +.#.###. +.#..#.. +.#..#.. +.#.###. +.###... +...#... +##.#... +..#...# +#..#.#. + +.###....# +#..##..## +#.####### +#.#...... +##...##.. +..##....# +#....##.. +###...... +#.#.####. +....####. +#####..## +.##...... +..##....# +####.##.# +.###.##.# + +.##.##.##..##.##. +.##.#.########.#. +.##.####.##.####. +#..######..###### +.......##..##.... +..#..##########.. +....#.##.##.##.#. +#..#.##.####.##.# +####..#......#..# + +#..####..##.. +.#..##..#..#. +.#......#..#. +..##..##....# +...#..#...... +#..#..#..##.. +.#......#..#. +#........##.. +...####...... +.###..###..## +...#..#...... +#..####..##.. +..#....#....# +#........##.# +.###..###..## + +#.#..##..#.#..... +#.#..##..#.#.##.. +...#.##.#...#..#. +.#........####.## +#.##.##.##.#...## +..#.####.#.....#. +####.##.######.## +###.#..#.###..### +..##.##.##...#..# +..##.##.##...#..# +###.#..#.###..### diff --git a/src/bin/day13/test_input.txt b/src/bin/day13/test_input.txt new file mode 100644 index 0000000..3b6b5cc --- /dev/null +++ b/src/bin/day13/test_input.txt @@ -0,0 +1,15 @@ +#.##..##. +..#.##.#. +##......# +##......# +..#.##.#. +..##..##. +#.#.##.#. + +#...##..# +#....#..# +..##..### +#####.##. +#####.##. +..##..### +#....#..#