You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: day05_test.ts
+28-24Lines changed: 28 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -12,34 +12,36 @@ Deno.test("Day 5: If You Give A Seed A Fertilizer", async (t) => {
12
12
*/
13
13
`50 98 2`,
14
14
/*
15
-
The second line means that the source range starts at 50 and contains 48 values: 50, 51, ..., 96, 97. This corresponds to a destination range starting at 52 and also containing 48 values: 52, 53, ..., 98, 99.
15
+
The second line means that the source range starts at 50 and contains 48 values: 50, 51, ..., 96, 97. This corresponds to a destination range starting at 52 and also containing 48 values: 52, 53, ..., 98, 99.
16
16
*/
17
17
`52 50 48`,
18
18
]);
19
-
for(const[seed,soil]of[
20
-
// With this information, you know that seed number 98 corresponds to soil number 50 and that seed number 99 corresponds to soil number 51.
21
-
[98,50],
22
-
[99,51],
23
-
// So, seed number 53 corresponds to soil number 55.
24
-
[53,55],
25
-
// Any source numbers that aren't mapped correspond to the same destination number. So, seed number 10 corresponds to soil number 10.
26
-
[10,10],
27
-
// With this map, you can look up the soil number required for each initial seed number:
28
-
[79,81],
29
-
[14,14],
30
-
[55,57],
31
-
[13,13],
32
-
]){
19
+
for(
20
+
const[seed,soil]of[
21
+
// With this information, you know that seed number 98 corresponds to soil number 50 and that seed number 99 corresponds to soil number 51.
22
+
[98,50],
23
+
[99,51],
24
+
// So, seed number 53 corresponds to soil number 55.
25
+
[53,55],
26
+
// Any source numbers that aren't mapped correspond to the same destination number. So, seed number 10 corresponds to soil number 10.
27
+
[10,10],
28
+
// With this map, you can look up the soil number required for each initial seed number:
29
+
[79,81],
30
+
[14,14],
31
+
[55,57],
32
+
[13,13],
33
+
]
34
+
){
33
35
awaitt.step(
34
36
`Seed number ${seed} corresponds to soil number ${soil}`,
0 commit comments