diff --git a/src/main/kotlin/Day06.kt b/src/main/kotlin/Day06.kt index 7b04da5..e3ea33f 100644 --- a/src/main/kotlin/Day06.kt +++ b/src/main/kotlin/Day06.kt @@ -43,10 +43,7 @@ class Day06 : AoCDay() { } } - private fun checkLoop( - obstacles: Set, - checkLoop: Boolean = false - ): Triple { + private fun checkLoop(obstacles: Set, checkLoop: Boolean = false): Triple { var counter = 0 val visited = mutableSetOf>(start to Vec2D.UP) var currentLocation = start @@ -84,31 +81,6 @@ class Day06 : AoCDay() { return Triple(false, uniqueLocations.size, counter) } - - fun printMap(visited: Set>, obstacles: Set) { - for (y in 0 until maxY) { - for (x in 0 until maxX) { - val pos = Vec2D(x, y) - var char = '.' - if (pos in obstacles) { - char = '#' - } else { - val movements = visited.filter { it.first == pos } - val topDown = movements.filter { it.second == Vec2D.UP || it.second == Vec2D.DOWN } - val leftRight = movements.filter { it.second == Vec2D.LEFT || it.second == Vec2D.RIGHT } - if (topDown.size != 0 && leftRight.size != 0) { - char = '+' - } else if (topDown.size != 0) { - char = '|' - } else if (leftRight.size != 0) { - char = '-' - } - } - print(char) - } - println() - } - } } fun main() {