csci2041/repo-zhan4854/Lab_15/examples/fibseq.src.txt

8 lines
159 B
Text
Raw Normal View History

2018-01-29 23:35:31 +00:00
function fib(x : int) =
if x < 1 then 1 else fib(x - 1) + fib(x - 2) end;
function fib_array(arr : int[]) =
mapseq(fib, arr);
fib_array([41,42,43,44])