Implement class finder for customized scripts resolving - not yet completely functional

This commit is contained in:
Ilya Chernikov
2016-06-01 14:07:13 +02:00
parent b63ed0f4aa
commit 3e17724e58
11 changed files with 190 additions and 35 deletions
+6 -3
View File
@@ -1,4 +1,4 @@
// Expecting two string parameters
// Expecting two string parameters or nothing
fun fib(n: Int): Int {
val v = if(n < 2) 1 else fib(n-1) + fib(n-2)
@@ -6,5 +6,8 @@ fun fib(n: Int): Int {
return v
}
System.out.println("num: ${args[0]} (${args[1]})")
val result = fib(java.lang.Integer.parseInt(args[0]))
val num = if (args.size > 0) java.lang.Integer.parseInt(args[0]) else 4
val comment = if (args.size > 1) args[1] else "none"
System.out.println("num: $num ($comment)")
val result = fib(num)