Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
GenerateFibonacci47
//Kotlin 1.1 import java.util.* fun main(vararg args: String) { println(fibonacci().take(47).toList()) } fun fibonacci(): Sequence<Int> { return generateSequence(Pair(0, 1)) { Pair(it.second, it.first + it.second) } .map { it.first } }
run
|
edit
|
history
|
help
0
Arun1
D
My script1
KotlinSessionVII#IS_OPERATOR
Calendar 2018 v3.2 (Compressed Coding)
Kotlin!
KotlineMerg
?. in Kotlin
Fibonacci in Kotlin
Kotlin