Day 2
[advent-of-code-2021.git] / day02 / task.txt
1 --- Day 2: Dive! ---
2 Now, you need to figure out how to pilot this thing.
3
4 It seems like the submarine can take a series of commands like forward 1, down 2, or up 3:
5
6 forward X increases the horizontal position by X units.
7 down X increases the depth by X units.
8 up X decreases the depth by X units.
9 Note that since you're on a submarine, down and up affect your depth, and so they have the opposite result of what you might expect.
10
11 The submarine seems to already have a planned course (your puzzle input). You should probably figure out where it's going. For example:
12
13 forward 5
14 down 5
15 forward 8
16 up 3
17 down 8
18 forward 2
19 Your horizontal position and depth both start at 0. The steps above would then modify them as follows:
20
21 forward 5 adds 5 to your horizontal position, a total of 5.
22 down 5 adds 5 to your depth, resulting in a value of 5.
23 forward 8 adds 8 to your horizontal position, a total of 13.
24 up 3 decreases your depth by 3, resulting in a value of 2.
25 down 8 adds 8 to your depth, resulting in a value of 10.
26 forward 2 adds 2 to your horizontal position, a total of 15.
27 After following these instructions, you would have a horizontal position of 15 and a depth of 10. (Multiplying these together produces 150.)
28
29 Calculate the horizontal position and depth you would have after following the planned course. What do you get if you multiply your final horizontal position by your final depth?
30
31 Your puzzle answer was 2272262.
32
33 --- Part Two ---
34 Based on your calculations, the planned course doesn't seem to make any sense. You find the submarine manual and discover that the process is actually slightly more complicated.
35
36 In addition to horizontal position and depth, you'll also need to track a third value, aim, which also starts at 0. The commands also mean something entirely different than you first thought:
37
38 down X increases your aim by X units.
39 up X decreases your aim by X units.
40 forward X does two things:
41 It increases your horizontal position by X units.
42 It increases your depth by your aim multiplied by X.
43 Again note that since you're on a submarine, down and up do the opposite of what you might expect: "down" means aiming in the positive direction.
44
45 Now, the above example does something different:
46
47 forward 5 adds 5 to your horizontal position, a total of 5. Because your aim is 0, your depth does not change.
48 down 5 adds 5 to your aim, resulting in a value of 5.
49 forward 8 adds 8 to your horizontal position, a total of 13. Because your aim is 5, your depth increases by 8*5=40.
50 up 3 decreases your aim by 3, resulting in a value of 2.
51 down 8 adds 8 to your aim, resulting in a value of 10.
52 forward 2 adds 2 to your horizontal position, a total of 15. Because your aim is 10, your depth increases by 2*10=20 to a total of 60.
53 After following these new instructions, you would have a horizontal position of 15 and a depth of 60. (Multiplying these produces 900.)
54
55 Using this new interpretation of the commands, calculate the horizontal position and depth you would have after following the planned course. What do you get if you multiply your final horizontal position by your final depth?
56
57 Your puzzle answer was 2134882034.
58
59 Both parts of this puzzle are complete! They provide two gold stars: **
60
61 At this point, you should return to your Advent calendar and try another puzzle.
62
63 If you still want to see it, you can get your puzzle input.
64
65 You can also [Share] this puzzle.--- Day 2: Dive! ---
66 Now, you need to figure out how to pilot this thing.
67
68 It seems like the submarine can take a series of commands like forward 1, down 2, or up 3:
69
70 forward X increases the horizontal position by X units.
71 down X increases the depth by X units.
72 up X decreases the depth by X units.
73 Note that since you're on a submarine, down and up affect your depth, and so they have the opposite result of what you might expect.
74
75 The submarine seems to already have a planned course (your puzzle input). You should probably figure out where it's going. For example:
76
77 forward 5
78 down 5
79 forward 8
80 up 3
81 down 8
82 forward 2
83 Your horizontal position and depth both start at 0. The steps above would then modify them as follows:
84
85 forward 5 adds 5 to your horizontal position, a total of 5.
86 down 5 adds 5 to your depth, resulting in a value of 5.
87 forward 8 adds 8 to your horizontal position, a total of 13.
88 up 3 decreases your depth by 3, resulting in a value of 2.
89 down 8 adds 8 to your depth, resulting in a value of 10.
90 forward 2 adds 2 to your horizontal position, a total of 15.
91 After following these instructions, you would have a horizontal position of 15 and a depth of 10. (Multiplying these together produces 150.)
92
93 Calculate the horizontal position and depth you would have after following the planned course. What do you get if you multiply your final horizontal position by your final depth?
94
95 Your puzzle answer was 2272262.
96
97 --- Part Two ---
98 Based on your calculations, the planned course doesn't seem to make any sense. You find the submarine manual and discover that the process is actually slightly more complicated.
99
100 In addition to horizontal position and depth, you'll also need to track a third value, aim, which also starts at 0. The commands also mean something entirely different than you first thought:
101
102 down X increases your aim by X units.
103 up X decreases your aim by X units.
104 forward X does two things:
105 It increases your horizontal position by X units.
106 It increases your depth by your aim multiplied by X.
107 Again note that since you're on a submarine, down and up do the opposite of what you might expect: "down" means aiming in the positive direction.
108
109 Now, the above example does something different:
110
111 forward 5 adds 5 to your horizontal position, a total of 5. Because your aim is 0, your depth does not change.
112 down 5 adds 5 to your aim, resulting in a value of 5.
113 forward 8 adds 8 to your horizontal position, a total of 13. Because your aim is 5, your depth increases by 8*5=40.
114 up 3 decreases your aim by 3, resulting in a value of 2.
115 down 8 adds 8 to your aim, resulting in a value of 10.
116 forward 2 adds 2 to your horizontal position, a total of 15. Because your aim is 10, your depth increases by 2*10=20 to a total of 60.
117 After following these new instructions, you would have a horizontal position of 15 and a depth of 60. (Multiplying these produces 900.)
118
119 Using this new interpretation of the commands, calculate the horizontal position and depth you would have after following the planned course. What do you get if you multiply your final horizontal position by your final depth?
120
121 Your puzzle answer was 2134882034.
122
123 Both parts of this puzzle are complete! They provide two gold stars: **
124
125 At this point, you should return to your Advent calendar and try another puzzle.
126
127 If you still want to see it, you can get your puzzle input.
128
129 You can also [Share] this puzzle.--- Day 2: Dive! ---
130 Now, you need to figure out how to pilot this thing.
131
132 It seems like the submarine can take a series of commands like forward 1, down 2, or up 3:
133
134 forward X increases the horizontal position by X units.
135 down X increases the depth by X units.
136 up X decreases the depth by X units.
137 Note that since you're on a submarine, down and up affect your depth, and so they have the opposite result of what you might expect.
138
139 The submarine seems to already have a planned course (your puzzle input). You should probably figure out where it's going. For example:
140
141 forward 5
142 down 5
143 forward 8
144 up 3
145 down 8
146 forward 2
147 Your horizontal position and depth both start at 0. The steps above would then modify them as follows:
148
149 forward 5 adds 5 to your horizontal position, a total of 5.
150 down 5 adds 5 to your depth, resulting in a value of 5.
151 forward 8 adds 8 to your horizontal position, a total of 13.
152 up 3 decreases your depth by 3, resulting in a value of 2.
153 down 8 adds 8 to your depth, resulting in a value of 10.
154 forward 2 adds 2 to your horizontal position, a total of 15.
155 After following these instructions, you would have a horizontal position of 15 and a depth of 10. (Multiplying these together produces 150.)
156
157 Calculate the horizontal position and depth you would have after following the planned course. What do you get if you multiply your final horizontal position by your final depth?
158
159 Your puzzle answer was 2272262.
160
161 --- Part Two ---
162 Based on your calculations, the planned course doesn't seem to make any sense. You find the submarine manual and discover that the process is actually slightly more complicated.
163
164 In addition to horizontal position and depth, you'll also need to track a third value, aim, which also starts at 0. The commands also mean something entirely different than you first thought:
165
166 down X increases your aim by X units.
167 up X decreases your aim by X units.
168 forward X does two things:
169 It increases your horizontal position by X units.
170 It increases your depth by your aim multiplied by X.
171 Again note that since you're on a submarine, down and up do the opposite of what you might expect: "down" means aiming in the positive direction.
172
173 Now, the above example does something different:
174
175 forward 5 adds 5 to your horizontal position, a total of 5. Because your aim is 0, your depth does not change.
176 down 5 adds 5 to your aim, resulting in a value of 5.
177 forward 8 adds 8 to your horizontal position, a total of 13. Because your aim is 5, your depth increases by 8*5=40.
178 up 3 decreases your aim by 3, resulting in a value of 2.
179 down 8 adds 8 to your aim, resulting in a value of 10.
180 forward 2 adds 2 to your horizontal position, a total of 15. Because your aim is 10, your depth increases by 2*10=20 to a total of 60.
181 After following these new instructions, you would have a horizontal position of 15 and a depth of 60. (Multiplying these produces 900.)
182
183 Using this new interpretation of the commands, calculate the horizontal position and depth you would have after following the planned course. What do you get if you multiply your final horizontal position by your final depth?
184
185 Your puzzle answer was 2134882034.
186
187 Both parts of this puzzle are complete! They provide two gold stars: **
188
189 At this point, you should return to your Advent calendar and try another puzzle.
190
191 If you still want to see it, you can get your puzzle input.
192
193 You can also [Share] this puzzle.