File tree Expand file tree Collapse file tree 2 files changed +10
-19
lines changed
main/java/com/github/saser/adventofcode/year2016/day16
test/java/com/github/saser/adventofcode/year2016/day16 Expand file tree Collapse file tree 2 files changed +10
-19
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public static Result part2(Reader r) {
18
18
private static Result solve (Reader r , int part ) {
19
19
try {
20
20
var state = Day16 .parse (r );
21
- state = Day16 .generate (state , 272 );
21
+ state = Day16 .generate (state , part == 1 ? 272 : 35651584 );
22
22
var checksum = Day16 .checksum (state );
23
23
return Result .ok (Day16 .toString (checksum ));
24
24
} catch (Exception e ) {
Original file line number Diff line number Diff line change @@ -18,22 +18,13 @@ public void part1Actual() throws IOException {
18
18
}
19
19
}
20
20
21
- // @Test
22
- // public void part2Example() {
23
- // var input = new StringReader("");
24
- // var output = "";
25
- // var result = Day16.part2(input);
26
- // Assert.assertEquals("no error", "", result.error);
27
- // Assert.assertEquals("correct output", output, result.answer);
28
- // }
29
-
30
- // @Test
31
- // public void part2Actual() throws IOException {
32
- // try (var input = new FileReader("inputs/2016/16")) {
33
- // var output = "";
34
- // var result = Day16.part2(input);
35
- // Assert.assertEquals("no error", "", result.error);
36
- // Assert.assertEquals("correct output", output, result.answer);
37
- // }
38
- // }
21
+ @ Test
22
+ public void part2Actual () throws IOException {
23
+ try (var input = new FileReader ("inputs/2016/16" )) {
24
+ var output = "01010100101011100" ;
25
+ var result = Day16 .part2 (input );
26
+ Assert .assertEquals ("no error" , "" , result .error );
27
+ Assert .assertEquals ("correct output" , output , result .answer );
28
+ }
29
+ }
39
30
}
You can’t perform that action at this time.
0 commit comments