My day 13 is here: <https://github.com/jorispz/aoc...
# advent-of-code
j
My day 13 is here: https://github.com/jorispz/aoc-2018/blob/master/src/commonMain/kotlin/P13.kt No interesting constructs that others haven't posted earlier, though I am quite pleased with
Copy code
private val turns = sequenceOf(Turn.LEFT, Turn.STRAIGHT, Turn.RIGHT).infinite().iterator()
Today's timings also nothing surprising (first/best of 25 in ms): JVM
182/13
, JS
206/75
, native
1048/995
👍 1
l
this .infinite() is your own implementation?
j
Yes, this was part of my Day 1 solution where you had to keep looping over the same set of frequencies: https://kotlinlang.slack.com/archives/C87V9MQFK/p1543658226002600?thread_ts=1543647542.002000&amp;cid=C87V9MQFK
l
Wow that's pretty awesome! I didn't know there's a yieldAll() 🙂 nice, I am borrowing this! 😁
👍 1