Day 19
[advent-of-code-17.git] / problems / day19.html
1 <!DOCTYPE html>
2 <html lang="en-us">
3 <head>
4 <meta charset="utf-8"/>
5 <title>Day 19 - Advent of Code 2017</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?12"/>
9 <link rel="stylesheet alternate" type="text/css" href="/static/highcontrast.css?0" title="High Contrast"/>
10 <link rel="shortcut icon" href="/favicon.ico?2"/>
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 probably took the longest; the easiest ones took an hour or two
31 each, but the harder ones took 4-5 hours, and a few even longer than that. A
32 lot of effort went into building this thing - I hope you're enjoying playing it
33 as much as I 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="/2017/about">[About]</a></li><li><a href="/2017/support">[AoC++]</a></li><li><a href="/2017/events">[Events]</a></li><li><a href="/2017/settings">[Settings]</a></li><li><a href="/2017/auth/logout">[Log Out]</a></li></ul></nav><div class="user">Neil Smith <span class="supporter">(AoC++)</span> <span class="star-count">38*</span></div></div><div><h1 class="title-event">&nbsp;&nbsp;&nbsp;<span class="title-event-wrap">0x0000|</span><a href="/2017">2017</a><span class="title-event-wrap"></span></h1><nav><ul><li><a href="/2017">[Calendar]</a></li><li><a href="/2017/leaderboard">[Leaderboard]</a></li><li><a href="/2017/stats">[Stats]</a></li><li><a href="/2017/sponsors">[Sponsors]</a></li></ul></nav></div></header>
91
92 <div id="sidebar">
93 <div id="sponsor"><div class="quiet">Our <a href="/2017/sponsors">sponsors</a> help make Advent of Code possible:</div><p><a href="http://kx.com/" target="_blank" onclick="if(ga)ga('send','event','sponsor','click',this.href);" rel="noopener">Kx Systems</a> - kdb+, the in-memory time series technology standard</p></div>
94 <p class="quiet">By popular demand, there are now AoC-themed objects available (until Jan. 3rd)! Get them shipped <a href="https://teespring.com/advent-of-code" target="_blank">from the US</a> or <a href="https://teespring.com/advent-of-code-eu" target="_blank">from Europe</a>.</p>
95
96 </div><!--/sidebar-->
97
98 <main>
99 <article class="day-desc"><h2>--- Day 19: A Series of Tubes ---</h2><p>Somehow, a network packet got <span title="I know how fast it's going, but I don't know where it is.">lost</span> and ended up here. It's trying to follow a routing diagram (your puzzle input), but it's confused about where to go.</p>
100 <p>Its starting point is just off the top of the diagram. Lines (drawn with <code>|</code>, <code>-</code>, and <code>+</code>) show the path it needs to take, starting by going down onto the only line connected to the top of the diagram. It needs to follow this path until it reaches the end (located somewhere within the diagram) and stop there.</p>
101 <p>Sometimes, the lines cross over each other; in these cases, it needs to continue going the same direction, and only turn left or right when there's no other option. In addition, someone has left <em>letters</em> on the line; these also don't change its direction, but it can use them to keep track of where it's been. For example:</p>
102 <pre><code> |
103 | +--+
104 A | C
105 F---|----E|--+
106 | | | D
107 +B-+ +--+
108
109 </code></pre>
110 <p>Given this diagram, the packet needs to take the following path:</p>
111 <ul>
112 <li>Starting at the only line touching the top of the diagram, it must go down, pass through <code>A</code>, and continue onward to the first <code>+</code>.</li>
113 <li>Travel right, up, and right, passing through <code>B</code> in the process.</li>
114 <li>Continue down (collecting <code>C</code>), right, and up (collecting <code>D</code>).</li>
115 <li>Finally, go all the way left through <code>E</code> and stopping at <code>F</code>.</li>
116 </ul>
117 <p>Following the path to the end, the letters it sees on its path are <code>ABCDEF</code>.</p>
118 <p>The little packet looks up at you, hoping you can help it find the way. <em>What letters will it see</em> (in the order it would see them) if it follows the path? (The routing diagram is very wide; make sure you view it without line wrapping.)</p>
119 </article>
120 <p>Your puzzle answer was <code>XYFDJNRCQA</code>.</p><article class="day-desc"><h2>--- Part Two ---</h2><p>The packet is curious how many steps it needs to go.</p>
121 <p>For example, using the same routing diagram from the example above...</p>
122 <pre><code> |
123 | +--+
124 A | C
125 F---|--|-E---+
126 | | | D
127 +B-+ +--+
128
129 </code></pre>
130 <p>...the packet would go:</p>
131 <ul>
132 <li><code>6</code> steps down (including the first line at the top of the diagram).</li>
133 <li><code>3</code> steps right.</li>
134 <li><code>4</code> steps up.</li>
135 <li><code>3</code> steps right.</li>
136 <li><code>4</code> steps down.</li>
137 <li><code>3</code> steps right.</li>
138 <li><code>2</code> steps up.</li>
139 <li><code>13</code> steps left (including the <code>F</code> it stops on).</li>
140 </ul>
141 <p>This would result in a total of <code>38</code> steps.</p>
142 <p><em>How many steps</em> does the packet need to go?</p>
143 </article>
144 <p>Your puzzle answer was <code>17450</code>.</p><p class="day-success">Both parts of this puzzle are complete! They provide two gold stars: **</p>
145 <p>At this point, you should <a href="/2017">return to your advent calendar</a> and try another puzzle.</p>
146 <p>If you still want to see it, you can <a href="19/input" target="_blank">get your puzzle input</a>.</p>
147 <p>You can also <span class="share">[Share<span class="share-content">on
148 <a href="https://twitter.com/intent/tweet?text=I%27ve+completed+%22A+Series+of+Tubes%22+%2D+Day+19+%2D+Advent+of+Code+2017&amp;url=http%3A%2F%2Fadventofcode%2Ecom%2F2017%2Fday%2F19&amp;related=ericwastl&amp;hashtags=AdventOfCode" target="_blank">Twitter</a>
149 <a href="https://plus.google.com/share?url=http%3A%2F%2Fadventofcode%2Ecom%2F2017%2Fday%2F19" target="_blank">Google+</a>
150 <a href="http://www.reddit.com/submit?url=http%3A%2F%2Fadventofcode%2Ecom%2F2017%2Fday%2F19&amp;title=I%27ve+completed+%22A+Series+of+Tubes%22+%2D+Day+19+%2D+Advent+of+Code+2017" target="_blank">Reddit</a
151 ></span>]</span> this puzzle.</p>
152 </main>
153
154 <!-- ga -->
155 <script>
156 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
157 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
158 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
159 })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
160 ga('create', 'UA-69522494-1', 'auto');
161 ga('send', 'pageview');
162 </script>
163 <!-- /ga -->
164 </body>
165 </html>