Paste: Fibonacci

Author: Rich
Mode: factor
Date: Wed, 12 Nov 2008 00:59:34
Plain Text |
USE: locals

: fib ( n -- ) [| x! [ 0 ]
                  y! [ 1 ] |
                    [ x y + y x! y! ] times x . ] ;

Annotation: fixed fib

Author: Rich
Mode: factor
Date: Wed, 12 Nov 2008 01:09:20
Plain Text |
USE: locals

: fib ( n -- m ) 1 + [let | x! [ 0 ]
                            y! [ 1 ] |
                            [ x y + y x! y! ] times x ] ;

Annotation: ok, the other ones sucked

Author: Rich
Mode: factor
Date: Wed, 12 Nov 2008 01:29:03
Plain Text |
USE: locals

: fib ( n -- m ) [let | x! [ 0 ]
                        y! [ 1 ] |
                        [ x y + y x! y! ] times y ] ;

New Annotation

Summary:
Author:
Mode:
Body: