Files
kotlin/compiler/testData/script/fib_ext.kts
2016-10-12 15:37:48 +02:00

17 lines
272 B
Kotlin
Vendored

// this script expected parameter num : Int
fun fib(n: Int): Int {
val v = if(n < 2) 1 else fib(n-1) + fib(n-2)
println("fib($n)=$v")
return v
}
val hdr = "Num".decapitalize()
org.junit.Assert.assertTrue(true)
println("$hdr: $num")
val result = fib(num)