comparison 2017/day19/problem @ 34:049fb8e56025

Add problem statements and inputs
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Tue, 09 Jan 2018 21:51:44 -0500
parents
children
comparison
equal deleted inserted replaced
33:bc652fa0a645 34:049fb8e56025
1 --- Day 19: A Series of Tubes ---
2
3 Somehow, a network packet got lost and ended up here. It's trying to
4 follow a routing diagram (your puzzle input), but it's confused about
5 where to go.
6
7 Its starting point is just off the top of the diagram. Lines (drawn
8 with |, -, and +) show the path it needs to take, starting by going
9 down onto the only line connected to the top of the diagram. It needs
10 to follow this path until it reaches the end (located somewhere within
11 the diagram) and stop there.
12
13 Sometimes, the lines cross over each other; in these cases, it needs
14 to continue going the same direction, and only turn left or right when
15 there's no other option. In addition, someone has left letters on the
16 line; these also don't change its direction, but it can use them to
17 keep track of where it's been. For example:
18
19 |
20 | +--+
21 A | C
22 F---|----E|--+
23 | | | D
24 +B-+ +--+
25
26 Given this diagram, the packet needs to take the following path:
27
28 Starting at the only line touching the top of the diagram, it must
29 go down, pass through A, and continue onward to the first +.
30
31 Travel right, up, and right, passing through B in the process.
32
33 Continue down (collecting C), right, and up (collecting D).
34
35 Finally, go all the way left through E and stopping at F.
36
37 Following the path to the end, the letters it sees on its path are
38 ABCDEF.
39
40 The little packet looks up at you, hoping you can help it find the
41 way. What letters will it see (in the order it would see them) if it
42 follows the path? (The routing diagram is very wide; make sure you
43 view it without line wrapping.)
44
45 Your puzzle answer was DTOUFARJQ.
46
47 --- Part Two ---
48
49 The packet is curious how many steps it needs to go.
50
51 For example, using the same routing diagram from the example above...
52
53 |
54 | +--+
55 A | C
56 F---|--|-E---+
57 | | | D
58 +B-+ +--+
59
60 ...the packet would go:
61
62 6 steps down (including the first line at the top of the diagram).
63
64 3 steps right.
65
66 4 steps up.
67
68 3 steps right.
69
70 4 steps down.
71
72 3 steps right.
73
74 2 steps up.
75
76 13 steps left (including the F it stops on).
77
78 This would result in a total of 38 steps.
79
80 How many steps does the packet need to go?
81
82 Your puzzle answer was 16642.
83
84 Both parts of this puzzle are complete! They provide two gold stars: **