todd.ginsberg
12/01/2019, 3:04 PMtodd.ginsberg
12/01/2019, 3:04 PMtodd.ginsberg
12/01/2019, 3:05 PMstkent
12/01/2019, 3:36 PMstkent
12/01/2019, 3:36 PMstkent
12/01/2019, 3:37 PMcoerceAtLeast
tho!todd.ginsberg
12/01/2019, 3:40 PMcoerceAtLeast
! That's cool.todd.ginsberg
12/01/2019, 3:45 PMkarelpeeters
12/01/2019, 10:10 PMprivate fun Int.fuelWithFuel(): Int =
if (this < 7) {
0
} else {
val fuel = this / 3 - 2
fuel + fuel.fuelWithFuel()
}
karelpeeters
12/01/2019, 10:11 PMJérôme Gully
12/01/2019, 11:04 PMtodd.ginsberg
12/01/2019, 11:06 PMtodd.ginsberg
12/02/2019, 12:26 AMtodd.ginsberg
12/02/2019, 12:38 AMstkent
12/02/2019, 12:39 AMtodd.ginsberg
12/02/2019, 12:39 AMstkent
12/02/2019, 12:39 AMSteve
12/02/2019, 1:47 AMfold
for the first part, and a do...while
loop for the second. I can't help but think there's a more... kotlin-y solution?karelpeeters
12/02/2019, 8:45 AMgenerateSequence
but I couldn't find anything that was actually better.