aboutsummaryrefslogtreecommitdiff
path: root/examples/fib.fco
blob: d459341c906078c7db714b4e729be83040c5782d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# fibonacci number
def fib(n)
    if <(n 2)
        n
    else
        +(fib(- (n 1)) fib(- (n 2)))
    end
end

def main()
    display("Running fib(20)...")
    display(fib(20))
end