The Squirrel interpreter. See http://www.squirrel-lang.org/
samples/fibonacci.nut
- Committer:
- jhnwkmn
- Date:
- 2014-12-16
- Revision:
- 0:97a4f8cc534c
File content as of revision 0:97a4f8cc534c:
/* * * Original Javascript version by David Hedbor(http://www.bagley.org/~doug/shootout/) * */ function fib(n) { if (n < 2) return 1 return fib(n-2) + fib(n-1) } local n = vargv.len()!=0?vargv[0].tointeger():1 print(fib(n)+"\n")