blob: c3b48ba07e7b6da3c3f19209cb4136a4b57a9de1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
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
|