diff --git a/src/main/kotlin/adventOfCode/Puzzle.kt b/src/main/kotlin/AdventOfCode/Puzzle.kt similarity index 95% rename from src/main/kotlin/adventOfCode/Puzzle.kt rename to src/main/kotlin/AdventOfCode/Puzzle.kt index b1069c1..93f4a5a 100644 --- a/src/main/kotlin/adventOfCode/Puzzle.kt +++ b/src/main/kotlin/AdventOfCode/Puzzle.kt @@ -1,4 +1,4 @@ -package adventOfCode +package AdventOfCode interface Puzzle { diff --git a/src/main/kotlin/adventOfCode2023/day1/Trebuchet.kt b/src/main/kotlin/AdventOfCode2023/day1/Trebuchet.kt similarity index 97% rename from src/main/kotlin/adventOfCode2023/day1/Trebuchet.kt rename to src/main/kotlin/AdventOfCode2023/day1/Trebuchet.kt index 455c5da..095792c 100644 --- a/src/main/kotlin/adventOfCode2023/day1/Trebuchet.kt +++ b/src/main/kotlin/AdventOfCode2023/day1/Trebuchet.kt @@ -1,6 +1,6 @@ -package adventOfCode2023.day1 +package AdventOfCode2023.day1 -import adventOfCode.Puzzle +import AdventOfCode.Puzzle class Trebuchet : Puzzle { override fun partOne() { diff --git a/src/main/kotlin/adventOfCode2023/day1/problem.txt b/src/main/kotlin/AdventOfCode2023/day1/problem.txt similarity index 100% rename from src/main/kotlin/adventOfCode2023/day1/problem.txt rename to src/main/kotlin/AdventOfCode2023/day1/problem.txt diff --git a/src/main/kotlin/adventOfCode2023/day2/CubeConundrum.kt b/src/main/kotlin/AdventOfCode2023/day2/CubeConundrum.kt similarity index 67% rename from src/main/kotlin/adventOfCode2023/day2/CubeConundrum.kt rename to src/main/kotlin/AdventOfCode2023/day2/CubeConundrum.kt index 7448350..d87b138 100644 --- a/src/main/kotlin/adventOfCode2023/day2/CubeConundrum.kt +++ b/src/main/kotlin/AdventOfCode2023/day2/CubeConundrum.kt @@ -1,6 +1,6 @@ -package adventOfCode2023.day2 +package AdventOfCode2023.day2 -import adventOfCode.Puzzle +import AdventOfCode.Puzzle import java.util.Scanner class CubeConundrum : Puzzle { @@ -54,6 +54,29 @@ class CubeConundrum : Puzzle { } override fun partTwo() { - TODO("Not yet implemented") + /* + For each game, find the minimum set of cubes that must have been present. + What is the sum of the power of these sets? + */ + val games = getGameList(); + var gamePower = 0 + val gameMaxConstraints = mapOf( + "red" to 12, + "green" to 13, + "blue" to 14 + ) + games.forEach { + + it.gameData?.forEach { gameData -> + val cubes = gameData.split(",") + cubes.forEach cubeForEach@ { cubeSet -> + val cubeData = cubeSet.trim().split(" ") + println() + } + } + + gamePower = 0 + } + println("The sum of the game ids is $gamePower.") } } \ No newline at end of file diff --git a/src/main/kotlin/adventOfCode2023/day2/Game.kt b/src/main/kotlin/AdventOfCode2023/day2/Game.kt similarity index 66% rename from src/main/kotlin/adventOfCode2023/day2/Game.kt rename to src/main/kotlin/AdventOfCode2023/day2/Game.kt index d23f555..a195d2d 100644 --- a/src/main/kotlin/adventOfCode2023/day2/Game.kt +++ b/src/main/kotlin/AdventOfCode2023/day2/Game.kt @@ -1,3 +1,3 @@ -package adventOfCode2023.day2 +package AdventOfCode2023.day2 data class Game(var id: Int, var gameData: List?) diff --git a/src/main/kotlin/adventOfCode2023/day2/problem.txt b/src/main/kotlin/AdventOfCode2023/day2/problem.txt similarity index 100% rename from src/main/kotlin/adventOfCode2023/day2/problem.txt rename to src/main/kotlin/AdventOfCode2023/day2/problem.txt diff --git a/src/main/kotlin/Main.kt b/src/main/kotlin/Main.kt index 6ca0f2a..01f320d 100644 --- a/src/main/kotlin/Main.kt +++ b/src/main/kotlin/Main.kt @@ -1,7 +1,7 @@ -import adventOfCode2023.day2.CubeConundrum +import AdventOfCode2023.day2.CubeConundrum fun main(args: Array) { val t = CubeConundrum() t.partOne() -// t.partTwo() + // t.partTwo() } \ No newline at end of file