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-16 5:32

check out my Algol DSL

var fibs = -> n (
    var rec;
    rec = -> a b i (
        if !i then
            a;
        else
            rec(b,a+b,i-1);
        end;
    );
    rec 0 1 n;
);

print fibs 10;

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