1
0

Update things

This commit is contained in:
2021-12-01 19:32:38 +01:00
parent ccfcf5a259
commit 322f8eb45a
53 changed files with 156 additions and 239 deletions
+2 -3
View File
@@ -1,14 +1,13 @@
package be.vandewalleh.aoc.days
import be.vandewalleh.aoc.utils.input.Day
import be.vandewalleh.aoc.utils.input.Input
import be.vandewalleh.aoc.utils.input.Lines
import org.eclipse.collections.api.bag.Bag
import org.eclipse.collections.api.bag.MutableBag
import org.eclipse.collections.api.factory.Bags
@Day(24)
class Day24(@Lines val input: Input<List<String>>) {
class Day24(@Lines val input: List<String>) {
private data class HexPoint(val x: Int, val y: Int, val z: Int) {
fun translate(other: HexPoint) = HexPoint(this.x + other.x, this.y + other.y, this.z + other.z)
@@ -31,7 +30,7 @@ class Day24(@Lines val input: Input<List<String>>) {
.map { Direction.valueOf(it.toUpperCase()) }
.toList()
private val tiles = input.value.map { parseTile(it) }.map {
private val tiles = input.map { parseTile(it) }.map {
it.map { it.coordinates }.reduce { acc, ints -> acc.translate(ints) }
}