summaryrefslogtreecommitdiff
path: root/sysroot/bin/sh/fib
blob: 6d84b1b94b50005c3d88eb446ba4afd2cf3ad790 (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/lua

function fib(n)
    if n <= 1 then return 1 end
    return fib(n-1) + fib(n-2)
end

for i=1,13 do
    print("fib("..i..")\t= " .. fib(i))
end