Fibonacci numbers in Forth
Example for versions
gforth 0.7.0
This example uses iterative definition of Fibonacci numbers.
: fib-iter
0 1 rot 0 ?do over + swap loop drop ;
: lp
1 do
i dup fib-iter . ." , "
loop drop ;
17 lp
." ..."
Comments
]]>blog comments powered by Disqus
]]>