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

Euclid's gcd

Name: Anonymous 2013-02-20 23:38

post your favourite implementation ``in symta''

Name: Anonymous 2013-02-21 22:11

function gcd(a) {
    return a.reduce(function (a, b) {
        if (!a) return b;
        for (; b;) a > b ? a -= b : b -= a;
        return a
    })
}

94 bytes, not counting whitespace. Not bad.

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