Skip to content

Instantly share code, notes, and snippets.

@marcoonroad
Created October 5, 2014 23:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcoonroad/9e20d2cb56245ee303bd to your computer and use it in GitHub Desktop.
Save marcoonroad/9e20d2cb56245ee303bd to your computer and use it in GitHub Desktop.
Fibonacci written in Forth.
\ == recursive version ==
: fib
dup 2 <= if
drop 1
else
dup 1 - recurse
swap 2 - recurse +
then ;
\ using:
10 fib .
\ == end of script ==
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment