diff options
Diffstat (limited to 'jni/ruby/sample/fib.awk')
-rw-r--r-- | jni/ruby/sample/fib.awk | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/jni/ruby/sample/fib.awk b/jni/ruby/sample/fib.awk new file mode 100644 index 0000000..9589f97 --- /dev/null +++ b/jni/ruby/sample/fib.awk @@ -0,0 +1,5 @@ +function fib(n) { + if ( n<2 ) return n; else return fib(n-2) + fib(n-1) +} + +BEGIN { print fib(20); } |