Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Elegant as fuck

Name: Anonymous 2011-05-15 20:42

def fib(times):
    a, b = 0,1
    for _ in range(times):
        a, b = b, a+b
    return a


I think I just creamed my pants.

Name: Anonymous 2011-05-15 21:43

>>1
SLOW AS FUCK

(define fib
    (let* ((√5 (sqrt 5))
           (φ (/ (add1 √5) 2)))
      (lambda (n)
        (round (/ (expt φ n) √5)))))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List