Day 10
[advent-of-code-18.git] / problems / day10.html
1 <!DOCTYPE html>
2 <html lang="en-us">
3 <head>
4 <meta charset="utf-8"/>
5 <title>Day 10 - Advent of Code 2018</title>
6 <!--[if lt IE 9]><script src="/static/html5.js"></script><![endif]-->
7 <link href='//fonts.googleapis.com/css?family=Source+Code+Pro:300&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
8 <link rel="stylesheet" type="text/css" href="/static/style.css?18"/>
9 <link rel="stylesheet alternate" type="text/css" href="/static/highcontrast.css?0" title="High Contrast"/>
10 <link rel="shortcut icon" href="/favicon.png"/>
11 </head><!--
12
13
14
15
16 Oh, hello! Funny seeing you here.
17
18 I appreciate your enthusiasm, but you aren't going to find much down here.
19 There certainly aren't clues to any of the puzzles. The best surprises don't
20 even appear in the source until you unlock them for real.
21
22 Please be careful with automated requests; I'm not Google, and I can only take
23 so much traffic. Please be considerate so that everyone gets to play.
24
25 If you're curious about how Advent of Code works, it's running on some custom
26 Perl code. Other than a few integrations (auth, analytics, ads, social media),
27 I built the whole thing myself, including the design, animations, prose, and
28 all of the puzzles.
29
30 The puzzles are most of the work; the easiest ones take 3-4 hours each, but the
31 harder ones take 6-8 hours, and a few even longer than that. A lot of effort
32 went into building this thing - I hope you're enjoying playing it as much as I
33 enjoyed making it for you!
34
35 If you'd like to hang out, I'm @ericwastl on Twitter.
36
37 - Eric Wastl
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 <body>
90 <header><div><h1 class="title-global"><a href="/">Advent of Code</a></h1><nav><ul><li><a href="/2018/about">[About]</a></li><li><a href="/2018/events">[Events]</a></li><li><a href="https://teespring.com/adventofcode" target="_blank">[Shop]</a></li><li><a href="/2018/settings">[Settings]</a></li><li><a href="/2018/auth/logout">[Log Out]</a></li></ul></nav><div class="user">Neil Smith <a href="/2018/support" class="supporter-badge" title="Advent of Code Supporter">(AoC++)</a> <span class="star-count">20*</span></div></div><div><h1 class="title-event">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">//</span><a href="/2018">2018</a><span class="title-event-wrap"></span></h1><nav><ul><li><a href="/2018">[Calendar]</a></li><li><a href="/2018/support">[AoC++]</a></li><li><a href="/2018/sponsors">[Sponsors]</a></li><li><a href="/2018/leaderboard">[Leaderboard]</a></li><li><a href="/2018/stats">[Stats]</a></li></ul></nav></div></header>
91
92 <div id="sidebar">
93 <div id="sponsor"><div class="quiet">Our <a href="/2018/sponsors">sponsors</a> help make Advent of Code possible:</div><div class="sponsor"><a href="https://clubhouse.io/?utm_source=spon&amp;utm_medium=ch&amp;utm_campaign=aoc2018" target="_blank" onclick="if(ga)ga('send','event','sponsor','click',this.href);" rel="noopener">Clubhouse</a> - The first project management platform for software development that brings everyone on every team together to build better products. AoC participants get two free months by signing up at r.clbh.se/mze9q9P Also, we're hiring!</div></div>
94 </div><!--/sidebar-->
95
96 <main>
97 <article class="day-desc"><h2>--- Day 10: The Stars Align ---</h2><p>It's no use; your navigation system simply isn't capable of providing <span title="At the iceberg, use any lane to turn left. Then, swim for eight thousand miles.">walking directions</span> in the arctic circle, and certainly not in 1018.</p>
98 <p>The Elves suggest an alternative. In times like these, North Pole rescue operations will arrange points of light in the sky to guide missing Elves back to base. Unfortunately, the message is easy to miss: the points move slowly enough that it takes hours to align them, but have so much momentum that they only stay aligned for a second. If you blink at the wrong time, it might be hours before another message appears.</p>
99 <p>You can see these points of light floating in the distance, and record their position in the sky and their velocity, the relative change in position per second (your puzzle input). The coordinates are all given from your perspective; given enough time, those positions and velocities will move the points into a cohesive message!</p>
100 <p>Rather than wait, you decide to fast-forward the process and calculate what the points will eventually spell.</p>
101 <p>For example, suppose you note the following points:</p>
102 <pre><code>position=< 9, 1> velocity=< 0, 2>
103 position=< 7, 0> velocity=<-1, 0>
104 position=< 3, -2> velocity=<-1, 1>
105 position=< 6, 10> velocity=<-2, -1>
106 position=< 2, -4> velocity=< 2, 2>
107 position=<-6, 10> velocity=< 2, -2>
108 position=< 1, 8> velocity=< 1, -1>
109 position=< 1, 7> velocity=< 1, 0>
110 position=<-3, 11> velocity=< 1, -2>
111 position=< 7, 6> velocity=<-1, -1>
112 position=<-2, 3> velocity=< 1, 0>
113 position=<-4, 3> velocity=< 2, 0>
114 position=<10, -3> velocity=<-1, 1>
115 position=< 5, 11> velocity=< 1, -2>
116 position=< 4, 7> velocity=< 0, -1>
117 position=< 8, -2> velocity=< 0, 1>
118 position=<15, 0> velocity=<-2, 0>
119 position=< 1, 6> velocity=< 1, 0>
120 position=< 8, 9> velocity=< 0, -1>
121 position=< 3, 3> velocity=<-1, 1>
122 position=< 0, 5> velocity=< 0, -1>
123 position=<-2, 2> velocity=< 2, 0>
124 position=< 5, -2> velocity=< 1, 2>
125 position=< 1, 4> velocity=< 2, 1>
126 position=<-2, 7> velocity=< 2, -2>
127 position=< 3, 6> velocity=<-1, -1>
128 position=< 5, 0> velocity=< 1, 0>
129 position=<-6, 0> velocity=< 2, 0>
130 position=< 5, 9> velocity=< 1, -2>
131 position=<14, 7> velocity=<-2, 0>
132 position=<-3, 6> velocity=< 2, -1>
133 </code></pre>
134 <p>Each line represents one point. Positions are given as <code>&lt;X, Y&gt;</code> pairs: X represents how far left (negative) or right (positive) the point appears, while Y represents how far up (negative) or down (positive) the point appears.</p>
135 <p>At <code>0</code> seconds, each point has the position given. Each second, each point's velocity is added to its position. So, a point with velocity <code>&lt;1, -2&gt;</code> is moving to the right, but is moving upward twice as quickly. If this point's initial position were <code>&lt;3, 9&gt;</code>, after <code>3</code> seconds, its position would become <code>&lt;6, 3&gt;</code>.</p>
136 <p>Over time, the points listed above would move like this:</p>
137 <pre><code>Initially:
138 ........#.............
139 ................#.....
140 .........#.#..#.......
141 ......................
142 #..........#.#.......#
143 ...............#......
144 ....#.................
145 ..#.#....#............
146 .......#..............
147 ......#...............
148 ...#...#.#...#........
149 ....#..#..#.........#.
150 .......#..............
151 ...........#..#.......
152 #...........#.........
153 ...#.......#..........
154
155 After 1 second:
156 ......................
157 ......................
158 ..........#....#......
159 ........#.....#.......
160 ..#.........#......#..
161 ......................
162 ......#...............
163 ....##.........#......
164 ......#.#.............
165 .....##.##..#.........
166 ........#.#...........
167 ........#...#.....#...
168 ..#...........#.......
169 ....#.....#.#.........
170 ......................
171 ......................
172
173 After 2 seconds:
174 ......................
175 ......................
176 ......................
177 ..............#.......
178 ....#..#...####..#....
179 ......................
180 ........#....#........
181 ......#.#.............
182 .......#...#..........
183 .......#..#..#.#......
184 ....#....#.#..........
185 .....#...#...##.#.....
186 ........#.............
187 ......................
188 ......................
189 ......................
190
191 After 3 seconds:
192 ......................
193 ......................
194 ......................
195 ......................
196 ......#...#..###......
197 ......#...#...#.......
198 ......#...#...#.......
199 ......#####...#.......
200 ......#...#...#.......
201 ......#...#...#.......
202 ......#...#...#.......
203 ......#...#..###......
204 ......................
205 ......................
206 ......................
207 ......................
208
209 After 4 seconds:
210 ......................
211 ......................
212 ......................
213 ............#.........
214 ........##...#.#......
215 ......#.....#..#......
216 .....#..##.##.#.......
217 .......##.#....#......
218 ...........#....#.....
219 ..............#.......
220 ....#......#...#......
221 .....#.....##.........
222 ...............#......
223 ...............#......
224 ......................
225 ......................
226 </code></pre>
227 <p>After 3 seconds, the message appeared briefly: <code><em>HI</em></code>. Of course, your message will be much longer and will take many more seconds to appear.</p>
228 <p><em>What message will eventually appear in the sky?</em></p>
229 </article>
230 <p>Your puzzle answer was <code>FNRGPBHR</code>.</p><article class="day-desc"><h2 id="part2">--- Part Two ---</h2><p>Good thing you didn't have to wait, because that would have taken a long time - much longer than the <code><em>3</em></code> seconds in the example above.</p>
231 <p>Impressed by your sub-hour communication capabilities, the Elves are curious: <em>exactly how many seconds would they have needed to wait for that message to appear?</em></p>
232 </article>
233 <p>Your puzzle answer was <code>10511</code>.</p><p class="day-success">Both parts of this puzzle are complete! They provide two gold stars: **</p>
234 <p>At this point, you should <a href="/2018">return to your advent calendar</a> and try another puzzle.</p>
235 <p>If you still want to see it, you can <a href="10/input" target="_blank">get your puzzle input</a>.</p>
236 <p>You can also <span class="share">[Share<span class="share-content">on
237 <a href="https://twitter.com/intent/tweet?text=I%27ve+completed+%22The+Stars+Align%22+%2D+Day+10+%2D+Advent+of+Code+2018&amp;url=https%3A%2F%2Fadventofcode%2Ecom%2F2018%2Fday%2F10&amp;related=ericwastl&amp;hashtags=AdventOfCode" target="_blank">Twitter</a>
238 <a href="http://www.reddit.com/submit?url=https%3A%2F%2Fadventofcode%2Ecom%2F2018%2Fday%2F10&amp;title=I%27ve+completed+%22The+Stars+Align%22+%2D+Day+10+%2D+Advent+of+Code+2018" target="_blank">Reddit</a
239 ></span>]</span> this puzzle.</p>
240 </main>
241
242 <!-- ga -->
243 <script>
244 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
245 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
246 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
247 })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
248 ga('create', 'UA-69522494-1', 'auto');
249 ga('send', 'pageview');
250 </script>
251 <!-- /ga -->
252 </body>
253 </html>