-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
1,511 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package no.rodland.advent_2023 | ||
|
||
import no.rodland.advent.Day | ||
|
||
// template generated: 13/12/2023 | ||
// Fredrik Rødland 2023 | ||
|
||
class Day13(val input: List<String>) : Day<Long, Long, List<String>> { | ||
|
||
private val parsed = input.parse() | ||
|
||
override fun partOne(): Long { | ||
return 2 | ||
} | ||
|
||
override fun partTwo(): Long { | ||
return 2 | ||
} | ||
|
||
override fun List<String>.parse(): List<String> { | ||
return map { line -> | ||
line | ||
} | ||
} | ||
|
||
override val day = "13".toInt() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package no.rodland.advent_2023 | ||
|
||
import no.rodland.advent.* | ||
import org.junit.jupiter.api.Nested | ||
import org.junit.jupiter.api.Test | ||
import readFile | ||
|
||
// | ||
// run: download_aoc_input.sh to download input | ||
// | ||
|
||
@Suppress("ClassName") | ||
@DisableSlow | ||
internal class Day13Test { | ||
private val data13 = "2023/input_13.txt".readFile() | ||
private val test13 = "2023/input_13_test.txt".readFile() | ||
|
||
private val resultTestOne = 2L | ||
private val resultTestTwo = 2L | ||
private val resultOne = 2L | ||
private val resultTwo = 2L | ||
|
||
val test = defaultTestSuiteParseOnInit( | ||
Day13(data13), | ||
Day13(test13), | ||
resultTestOne, | ||
resultOne, | ||
resultTestTwo, | ||
resultTwo, | ||
{ Day13(data13) }, | ||
{ Day13(test13) }, | ||
) | ||
|
||
@Nested | ||
inner class Init { | ||
@Test | ||
fun `13,-,example,1`() { | ||
report(AOCTest({ "123".toInt() }, Unit, 123, 5, "13".toInt(), Part.TWO, false, "example")) | ||
} | ||
|
||
@Test | ||
fun `13,-,example,2`() { | ||
report(test.initTest.copy()) | ||
} | ||
|
||
@Test | ||
fun `13,-,test,init`() { | ||
report(test.initTest) | ||
} | ||
|
||
@Test | ||
fun `13,-,live,init`() { | ||
report(test.initLive) | ||
} | ||
} | ||
|
||
@Nested | ||
inner class `Part 1` { | ||
@Test | ||
fun `13,1,test`() { | ||
report(test.testPart1) | ||
} | ||
|
||
@Test | ||
fun `13,1,live,1`() { | ||
report(test.livePart1) | ||
} | ||
} | ||
|
||
@Nested | ||
inner class `Part 2` { | ||
@Test | ||
fun `13,2,test`() { | ||
report(test.testPart2) | ||
} | ||
|
||
@Test | ||
fun `13,2,live,1`() { | ||
report(test.livePart2) | ||
} | ||
} | ||
} |
Oops, something went wrong.