Skip to content

Commit

Permalink
Remove debug print
Browse files Browse the repository at this point in the history
  • Loading branch information
derNiklaas committed Dec 6, 2024
1 parent 86ac21d commit bd95d40
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions src/main/kotlin/Day06.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ class Day06 : AoCDay() {
}
}

private fun checkLoop(
obstacles: Set<Vec2D>,
checkLoop: Boolean = false
): Triple<Boolean, Int, Int> {
private fun checkLoop(obstacles: Set<Vec2D>, checkLoop: Boolean = false): Triple<Boolean, Int, Int> {
var counter = 0
val visited = mutableSetOf<Pair<Vec2D, Vec2D>>(start to Vec2D.UP)
var currentLocation = start
Expand Down Expand Up @@ -84,31 +81,6 @@ class Day06 : AoCDay() {

return Triple(false, uniqueLocations.size, counter)
}

fun printMap(visited: Set<Pair<Vec2D, Vec2D>>, obstacles: Set<Vec2D>) {
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() {
Expand Down

0 comments on commit bd95d40

Please sign in to comment.