My Day13, my coroutine/Channel IntCode implementat...
# advent-of-code
My Day13, my coroutine/Channel IntCode implementation is holding up fairly well, though it requires a bit too much boilerplate right now to setup the channels etc. I have somewhat lost interest in doing the performance measurements for JS and native, I'll do them at some point and update the README in Github then.
Mine ended up looking similar except I just throw away the read for
. 🙂
Lol yeah good point.
What pleasantly surprised me is that I didn't have to initialize the
var ballPosition: Int
on line 54. The compiler was smart enough to figure out it would never be null in practice. I ❤️ Kotlin
Or 'used before initialization' I should probably say
Yeah, mine is similar. It's like voodoo. It feels wrong to not init it though.
The only place you use ball pos is on line 71 and you set the value on line 70. So it's quite clear that it will be set. You don't even need the var
Yeah that's right, it's a leftover from an earlier iteration