Fibonacci numbers in FP
Example for versions
Furry Paws
This example works exactly like the one for Interactive FP.
one = eq.[id, ~1]
dec = sub.[id, ~1]
seq = one -> [~1] ; cat.[seq.dec, [id]]
fibonacci = lt.[id, ~3] -> ~1 ; add.[fibonacci.sub.[id, ~1], fibonacci.sub.[id, ~2]]
main = show.(return @fibonacci.(seq.~16))
Comments
]]>blog comments powered by Disqus
]]>