Skip to content

Commit

Permalink
Fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeltroger committed Dec 12, 2021
1 parent 51ddc17 commit 19427ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Day11.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ fun main() {
}

// test if implementation meets criteria from the description, like:
val testInput = readInput(day = DAY, useTestInput = true).toIntArray()
val testInput = readInput(day = DAY, useTestInput = true).parseInput()
check(part1(testInput) == 1656)
check(part2(testInput) == 195)

val input = readInput(day = DAY).toIntArray()
val input = readInput(day = DAY).parseInput()
println(part1(input))
println(part2(input))
}
Expand Down Expand Up @@ -140,6 +140,6 @@ private fun makeOctopusFlash(octopuses: Array<IntArray>, x: Int, y: Int, flashed
}
}

private fun List<String>.toIntArray(): List<List<Int>> {
private fun List<String>.parseInput(): List<List<Int>> {
return map { it.map { it.toString().toInt() } }
}

0 comments on commit 19427ce

Please sign in to comment.