-
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.
Extract common code to
Challenge
class
- Loading branch information
Showing
20 changed files
with
224 additions
and
144 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
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
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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,28 +1,20 @@ | ||
package com.fwdekker.aoc.y2023 | ||
|
||
import com.fwdekker.aoc.Day | ||
import com.fwdekker.aoc.Day.Companion.resource | ||
import com.fwdekker.aoc.DayTest | ||
import com.fwdekker.std.ChallengeTest | ||
import com.fwdekker.std.case | ||
import io.kotest.core.annotation.Tags | ||
|
||
|
||
/** | ||
* Tests for samples of [Day24]. | ||
*/ | ||
object Day24SamplesTest : DayTest( | ||
{ resource -> Day24(resource, 7L..27L) }, | ||
@Tags("2023") | ||
object Day24Test : ChallengeTest( | ||
{ sample -> | ||
if (sample == 1) Day24(sample, 7L..27L) | ||
else Day24(sample) | ||
}, | ||
listOf( | ||
Triple(resource(2023, 24, sample = 1), Day::part1, 2L), | ||
Triple(resource(2023, 24, sample = 1), Day::part2, 47L), | ||
) | ||
) | ||
|
||
/** | ||
* Tests for [Day24]. | ||
*/ | ||
object Day24Test : DayTest( | ||
::Day24, | ||
listOf( | ||
Triple(resource(2023, 24), Day::part1, 16727L), | ||
Triple(resource(2023, 24), Day::part2, 606772018765659L), | ||
case(part = 1, sample = 1) to 2L, | ||
case(part = 2, sample = 1) to 47L, | ||
case(part = 1) to 16727L, | ||
case(part = 2) to 606772018765659L, | ||
) | ||
) |
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 |
---|---|---|
@@ -1,18 +1,17 @@ | ||
package com.fwdekker.aoc.y2024 | ||
|
||
import com.fwdekker.aoc.Day | ||
import com.fwdekker.aoc.DayTest | ||
import com.fwdekker.std.ChallengeTest | ||
import com.fwdekker.std.case | ||
import io.kotest.core.annotation.Tags | ||
|
||
|
||
/** | ||
* Tests for [Day11]. | ||
*/ | ||
object Day11Test : DayTest( | ||
@Tags("2024") | ||
object Day11Test : ChallengeTest( | ||
::Day11, | ||
listOf( | ||
Triple(Day.resource(2024, 11, sample = 1), Day::part1, 7L), | ||
Triple(Day.resource(2024, 11, sample = 2), Day::part1, 55312L), | ||
Triple(Day.resource(2024, 11), Day::part1, 216996L), | ||
Triple(Day.resource(2024, 11), Day::part2, 257335372288947L), | ||
case(part = 1, sample = 1) to 7L, | ||
case(part = 1, sample = 2) to 55312L, | ||
case(part = 1) to 216996L, | ||
case(part = 2) to 257335372288947L, | ||
) | ||
) |
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 |
---|---|---|
@@ -1,18 +1,19 @@ | ||
package com.fwdekker.aoc.y2024 | ||
|
||
import com.fwdekker.aoc.Day | ||
import com.fwdekker.aoc.DayTest | ||
import io.kotest.core.annotation.Ignored | ||
import java.math.BigInteger | ||
import com.fwdekker.std.ChallengeTest | ||
import com.fwdekker.std.case | ||
import io.kotest.core.annotation.Tags | ||
|
||
|
||
/** | ||
* Tests for [Day14]. | ||
*/ | ||
object Day14Test : DayTest( | ||
::Day14, | ||
@Tags("2024") | ||
object Day14Test : ChallengeTest( | ||
{ sample -> | ||
if (sample == 1) Day14(sample, width = 11, height = 7) | ||
else Day14(sample) | ||
}, | ||
listOf( | ||
Triple(Day.resource(2024, 14), Day::part1, 217328832), | ||
Triple(Day.resource(2024, 14), Day::part2, 7412), | ||
case(part = 1, sample = 1) to 12, | ||
case(part = 1) to 217328832, | ||
case(part = 2) to 7412, | ||
) | ||
) |
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 |
---|---|---|
@@ -1,19 +1,18 @@ | ||
package com.fwdekker.aoc.y2024 | ||
|
||
import com.fwdekker.aoc.Day | ||
import com.fwdekker.aoc.DayTest | ||
import com.fwdekker.std.ChallengeTest | ||
import com.fwdekker.std.case | ||
import io.kotest.core.annotation.Tags | ||
|
||
|
||
/** | ||
* Tests for [Day15]. | ||
*/ | ||
object Day15Test : DayTest( | ||
@Tags("2024") | ||
object Day15Test : ChallengeTest( | ||
::Day15, | ||
listOf( | ||
Triple(Day.resource(2024, 15, sample = 1), Day::part1, 2028L), | ||
Triple(Day.resource(2024, 15, sample = 2), Day::part1, 10092L), | ||
Triple(Day.resource(2024, 15, sample = 2), Day::part2, 9021L), | ||
Triple(Day.resource(2024, 15), Day::part1, 1471826L), | ||
Triple(Day.resource(2024, 15), Day::part2, 1457703L), | ||
case(part = 1, sample = 1) to 2028L, | ||
case(part = 1, sample = 2) to 10092L, | ||
case(part = 2, sample = 2) to 9021L, | ||
case(part = 1) to 1471826L, | ||
case(part = 2) to 1457703L, | ||
) | ||
) |
Oops, something went wrong.