summaryrefslogblamecommitdiffstats
path: root/test/fib.t
blob: 2a24f6d773c6e16a21e3579ec48f44cf4f6e62eb (plain) (tree)
1
2
3
4
5
6
7
8
9







                                          
             

               
                       


                                       

                 
   
fun fib[a]
	if a < 2
		@1
	end
	@( call fib[a-1] + call fib[a-2] )
end

# main function
fun main[num]
	sum = 0
	i = 0
	while (i < num)
		sum = sum + call fib[i]
		i = i + 1
	end
	print sum
	@0
end