mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-04-04 15:51:54 +00:00
also remove some tests that are covered in the scripting-compiler tests now. Part of the cleanup to rewrite scripting to the new infrastructure.
14 lines
341 B
Kotlin
Vendored
14 lines
341 B
Kotlin
Vendored
// Expecting two string parameters or nothing
|
|
|
|
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 num = if (args.size > 0) java.lang.Integer.parseInt(args[0]) else 4
|
|
val comment = if (args.size > 1) args[1] else "none"
|
|
|
|
println("num: $num ($comment)")
|
|
val result = fib(num)
|