1e59de90 TL |
1 | // fib.js |
2 | function fib(n) { |
3 | if (n == 0) { return 0; } |
4 | if (n == 1) { return 1; } |
5 | return fib(n-1) + fib(n-2); |
6 | } |
7 | |
8 | function test() { |
9 | var res = []; |
10 | for (i = 0; i < 20; i++) { |
11 | res.push(fib(i)); |
12 | } |
13 | print(res.join(' ')); |
14 | } |
15 | |
16 | test(); |