Skip to content

Commit d2cb625

Browse files
committed
2024 - Day 25 - input/init
1 parent 98b36d6 commit d2cb625

File tree

4 files changed

+4147
-0
lines changed

4 files changed

+4147
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package no.rodland.advent_2024
2+
3+
import no.rodland.advent.Day
4+
5+
// template generated: 25/12/2024
6+
// Fredrik Rødland 2024
7+
8+
class Day25(val input: List<String>) : Day<Long, Long, List<String>> {
9+
10+
private val parsed = input.parse()
11+
12+
override fun partOne(): Long {
13+
return 2
14+
}
15+
16+
override fun partTwo(): Long {
17+
return 2
18+
}
19+
20+
override fun List<String>.parse(): List<String> {
21+
return map { line ->
22+
line
23+
}
24+
}
25+
26+
override val day = "25".toInt()
27+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
package no.rodland.advent_2024
2+
3+
import no.rodland.advent.*
4+
import org.junit.jupiter.api.Nested
5+
import org.junit.jupiter.api.Test
6+
import readFile
7+
8+
//
9+
// run: download_aoc_input.sh to download input
10+
//
11+
12+
@Suppress("ClassName")
13+
@DisableSlow
14+
internal class Day25Test {
15+
private val data25 = "2024/input_25.txt".readFile()
16+
private val test25 = "2024/input_25_test.txt".readFile()
17+
18+
private val resultTestOne = 2L
19+
private val resultTestTwo = 2L
20+
private val resultOne = 2L
21+
private val resultTwo = 2L
22+
23+
val test = defaultTestSuiteParseOnInit(
24+
Day25(data25),
25+
Day25(test25),
26+
resultTestOne,
27+
resultOne,
28+
resultTestTwo,
29+
resultTwo,
30+
{ Day25(data25) },
31+
{ Day25(test25) },
32+
)
33+
34+
@Nested
35+
inner class Init {
36+
@Test
37+
fun `25,-,example,1`() {
38+
report(AOCTest({ "123".toInt() }, Unit, 123, 5, "25".toInt(), Part.TWO, false, "example"))
39+
}
40+
41+
@Test
42+
fun `25,-,example,2`() {
43+
report(test.initTest.copy())
44+
}
45+
46+
@Test
47+
fun `25,-,test,init`() {
48+
report(test.initTest)
49+
}
50+
51+
@Test
52+
fun `25,-,live,init`() {
53+
report(test.initLive)
54+
}
55+
}
56+
57+
@Nested
58+
inner class `Part 1` {
59+
@Test
60+
fun `25,1,test`() {
61+
report(test.testPart1)
62+
}
63+
64+
@Test
65+
fun `25,1,live,1`() {
66+
report(test.livePart1)
67+
}
68+
}
69+
70+
@Nested
71+
inner class `Part 2` {
72+
@Test
73+
fun `25,2,test`() {
74+
report(test.testPart2)
75+
}
76+
77+
@Test
78+
fun `25,2,live,1`() {
79+
report(test.livePart2)
80+
}
81+
}
82+
}

0 commit comments

Comments
 (0)