diff options
Diffstat (limited to 'src/20/part2')
| -rw-r--r-- | src/20/part2 | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/src/20/part2 b/src/20/part2 new file mode 100644 index 0000000..c3b48ba --- /dev/null +++ b/src/20/part2 @@ -0,0 +1,110 @@ +--- Part Two --- + +Now, you're ready to [1m[37mcheck the image for sea monsters[0m. + +The borders of each tile are not part of the actual image; start by removing them. + +In the example above, the tiles become: + +.#.#..#. ##...#.# #..##### +###....# .#....#. .#...... +##.##.## #.#.#..# #####... +###.#### #...#.## ###.#..# +##.#.... #.##.### #...#.## +...##### ###.#... .#####.# +....#..# ...##..# .#.###.. +.####... #..#.... .#...... + +#..#.##. .#..###. #.##.... +#.####.. #.####.# .#.###.. +###.#.#. ..#.#### ##.#..## +#.####.. ..##..## ######.# +##..##.# ...#...# .#.#.#.. +...#..#. .#.#.##. .###.### +.#.#.... #.##.#.. .###.##. +###.#... #..#.##. ######.. + +.#.#.### .##.##.# ..#.##.. +.####.## #.#...## #.#..#.# +..#.#..# ..#.#.#. ####.### +#..####. ..#.#.#. ###.###. +#####..# ####...# ##....## +#.##..#. .#...#.. ####...# +.#.###.. ##..##.. ####.##. +...###.. .##...#. ..#..### + +Remove the gaps to form the actual image: + +.#.#..#.##...#.##..##### +###....#.#....#..#...... +##.##.###.#.#..######... +###.#####...#.#####.#..# +##.#....#.##.####...#.## +...########.#....#####.# +....#..#...##..#.#.###.. +.####...#..#.....#...... +#..#.##..#..###.#.##.... +#.####..#.####.#.#.###.. +###.#.#...#.######.#..## +#.####....##..########.# +##..##.#...#...#.#.#.#.. +...#..#..#.#.##..###.### +.#.#....#.##.#...###.##. +###.#...#..#.##.######.. +.#.#.###.##.##.#..#.##.. +.####.###.#...###.#..#.# +..#.#..#..#.#.#.####.### +#..####...#.#.#.###.###. +#####..#####...###....## +#.##..#..#...#..####...# +.#.###..##..##..####.##. +...###...##...#...#..### + +Now, you're ready to search for sea monsters! Because your image is monochrome, a sea monster will +look like this: + + # +# ## ## ### + # # # # # # + +When looking for this pattern in the image, [1m[37mthe spaces can be anything[0m; only the # need +to match. Also, you might need to rotate or flip your image before it's oriented correctly to find +sea monsters. In the above image, [1m[37mafter flipping and rotating it[0m to the appropriate +orientation, there are [1m[37mtwo[0m sea monsters (marked with [1m[37mO[0m): + +.####...#####..#...###.. +#####..#..#.#.####..#.#. +.#.#...#.###...#.##.[1m[37mO[0m#.. + +#.[1m[37mO[0m.##.[1m[37mO[0m[1m[37mO[0m#.#.[1m[37mO[0m[1m[37mO[0m.##.[1m[37mO[0m[1m[37mO[0m[1m[37mO[0m## + +..#[1m[37mO[0m.#[1m[37mO[0m#.[1m[37mO[0m##[1m[37mO[0m..[1m[37mO[0m.#[1m[37mO[0m##.## +...#.#..##.##...#..#..## +#.##.#..#.#..#..##.#.#.. +.###.##.....#...###.#... +#.####.#.#....##.#..#.#. +##...#..#....#..#...#### +..#.##...###..#.#####..# +....#.##.#.#####....#... +..##.##.###.....#.##..#. +#...#...###..####....##. +.#.##...#.##.#.#.###...# +#.###.#..####...##..#... +#.###...#.##...#.##[1m[37mO[0m###. + +.[1m[37mO[0m##.#[1m[37mO[0m[1m[37mO[0m.###[1m[37mO[0m[1m[37mO[0m##..[1m[37mO[0m[1m[37mO[0m[1m[37mO[0m##. + +..[1m[37mO[0m#.[1m[37mO[0m..[1m[37mO[0m..[1m[37mO[0m.#[1m[37mO[0m##[1m[37mO[0m##.### +#.#..##.########..#..##. +#.#####..#.#...##..#.... +#....##..#.#########..## +#...#.....#..##...###.## +#..###....##.#...##.##.# + +Determine how rough the waters are in the sea monsters' habitat by counting the number of # that are +[1m[37mnot[0m part of a sea monster. In the above example, the habitat's water roughness is +[1m[37m273[0m. + +[1m[37mHow many # are not part of a sea monster?[0m + + |
