From 61de7c46e2b7096578f8bd2f7ba76be564888782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20R=C3=B8dland?= Date: Wed, 25 Dec 2024 13:56:47 +0100 Subject: [PATCH] 2024 - Day 24 - tweaked part 1 tests. --- src/main/kotlin/no/rodland/advent_2024/Day24.kt | 8 +++----- src/test/kotlin/no/rodland/advent_2024/Day24Test.kt | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/no/rodland/advent_2024/Day24.kt b/src/main/kotlin/no/rodland/advent_2024/Day24.kt index 1cbfc6f5..66989018 100644 --- a/src/main/kotlin/no/rodland/advent_2024/Day24.kt +++ b/src/main/kotlin/no/rodland/advent_2024/Day24.kt @@ -13,9 +13,9 @@ class Day24(val input: List) : Day buildNode(system, logic, k, v) } - println("hm - ran through buildNode: $i") - return map + return logic + .asSequence() + .map { (k, v) -> buildNode(system, logic, k, v) } .filter { it.name.startsWith("z") } .sortedByDescending { it.name } .map { it.input.value } @@ -23,10 +23,8 @@ class Day24(val input: List) : Day, input: Map, k: String, v: String): Wire { system[k]?.let { wire -> return wire } - i++ val (aKey, op, bKey) = v.split(" ") val a = system[aKey] ?: buildNode(system, input, aKey, input[aKey]!!) val b = system[bKey] ?: buildNode(system, input, bKey, input[bKey]!!) diff --git a/src/test/kotlin/no/rodland/advent_2024/Day24Test.kt b/src/test/kotlin/no/rodland/advent_2024/Day24Test.kt index adb04d4c..594bc766 100644 --- a/src/test/kotlin/no/rodland/advent_2024/Day24Test.kt +++ b/src/test/kotlin/no/rodland/advent_2024/Day24Test.kt @@ -29,7 +29,7 @@ internal class Day24Test { resultTwo, { Day24(data24) }, { Day24(test24) }, - numTestPart1 = 1 + numTestPart2 = 1 ) @Nested