Dmitry Nekrasov
11/06/2025, 12:05 PMzsmb
11/06/2025, 12:12 PMphldavies
11/06/2025, 1:08 PMephemient
11/06/2025, 4:26 PMJakub Gwóźdź
11/07/2025, 6:27 AMephemient
11/07/2025, 6:49 AMephemient
11/07/2025, 6:56 AMJakub Gwóźdź
11/07/2025, 7:08 AMCaroline Mouden
11/07/2025, 10:05 AMDmitry Nekrasov
11/07/2025, 10:34 AMJakub Gwóźdź
11/07/2025, 10:49 AMdata class Pos(...) every one year...Jakub Gwóźdź
11/07/2025, 10:57 AMtypealias Pos = Long with companion functions that treats one half of bits as row and another as column - should be a benchmark killer)ephemient
11/07/2025, 11:39 AM@JvmInline
value class IntPair private constructor(private val packed: Long) {
constructor(first: Into, second: Int) : this(first.toLong().shl(32) or second.toLong().and(0xffffffffL))
val first: Int
get() = packed.shr(32).toInt()
val second: Int
get() = packed.toInt()
}
plus copy and operator component# if you wantDmitry Nekrasov
11/07/2025, 11:41 AMJakub Gwóźdź
11/07/2025, 11:57 AMNorbert Kiesel
11/08/2025, 12:22 AMString.ints() which extracts all Ints from a string (which is often required to parse the puzzle inputs).ephemient
11/08/2025, 1:46 AM./gradlew --continuous jvmTest running in the background to immediately see results as I codeJakub Gwóźdź
11/08/2025, 1:57 PMfun main() { ... } in every day's file, but then I also have this gem in my `Commons.kt`:
inline fun go(expected: Any? = null, desc: String = "", op: () -> Any) {
val result = op()
println("$desc$result")
if (expected != null) check(result.toString() == expected.toString()) { "expected $expected" }
}
and my main() calls it with expected results (for examples) like:
fun main() {
go(4, "Example 1a:") { part1(example1) }
go(2024, "Example 1b:") { part1(example2) }
go(45213383376616) { part1(readAllText("local/day24_input.txt")) }
go() { part2(readAllText("local/day24_input.txt")) }
...
}Jakub Gwóźdź
11/08/2025, 1:59 PMDmitry Nekrasov
11/11/2025, 4:17 PMJakub Gwóźdź
11/11/2025, 4:35 PMNorbert Kiesel
11/13/2025, 1:09 AM