Update things
This commit is contained in:
@@ -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) }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user