Skip to main content
I think thats as smoll as it gets
Source Link

In the interest of providing an alternate from the while loops already given:

var f = (a, b, c, m) => (b + c >= m) ? a : f(a.concat([b + c]), c, b + c, m);
var fib = f([1, 1], 1, 1, 10);

Less pretty version for golfs sake (4843 chars)

m=10;a=[];fora=[];for(b=c=1;c<=m&&ab=c=1;c<=10&&a.push(b,c);c+=b+=c);aa

In the interest of providing an alternate from the while loops already given:

var f = (a, b, c, m) => (b + c >= m) ? a : f(a.concat([b + c]), c, b + c, m);
var fib = f([1, 1], 1, 1, 10);

Less pretty version for golfs sake (48 chars)

m=10;a=[];for(b=c=1;c<=m&&a.push(b,c);c+=b+=c);a

In the interest of providing an alternate from the while loops already given:

var f = (a, b, c, m) => (b + c >= m) ? a : f(a.concat([b + c]), c, b + c, m);
var fib = f([1, 1], 1, 1, 10);

Less pretty version for golfs sake (43 chars)

a=[];for(b=c=1;c<=10&&a.push(b,c);c+=b+=c)a
ya we golfin
Source Link

In the interest of providing an alternate from the while loops already given:

var f = (a, b, c, m) => (b + c >= m) ? a : f(a.concat([b + c]), c, b + c, m);
var fib = f([1, 1], 1, 1, 10);

Less pretty version for golfs sake (5548 chars)

m=10;f=(a,b,c)=>(b>=m)?a:fm=10;a=[];for(ab=c=1;c<=m&&a.concatpush(b),c,b+c);f([],1,1;c+=b+=c);a

In the interest of providing an alternate from the while loops already given:

var f = (a, b, c, m) => (b + c >= m) ? a : f(a.concat([b + c]), c, b + c, m);
var fib = f([1, 1], 1, 1, 10);

Less pretty (55 chars)

m=10;f=(a,b,c)=>(b>=m)?a:f(a.concat(b),c,b+c);f([],1,1)

In the interest of providing an alternate from the while loops already given:

var f = (a, b, c, m) => (b + c >= m) ? a : f(a.concat([b + c]), c, b + c, m);
var fib = f([1, 1], 1, 1, 10);

Less pretty version for golfs sake (48 chars)

m=10;a=[];for(b=c=1;c<=m&&a.push(b,c);c+=b+=c);a
still golfin' sorry
Source Link

In the interest of providing an alternate from the while loops already given:

var f = (a, b, c, m) => (b + c >= m) ? a : f(a.concat([b + c]), c, b + c, m);
var fib = f([1, 1], 1, 1, 10);

Less pretty (9455 chars)

f = m=10;f=(a, b, c, m) => (b + c >= mb>=m) ? a : f(a.concat([b + c]b), c, b + c, mb+c); f;f([1, 1][], 1, 1, 10);

In the interest of providing an alternate from the while loops already given:

var f = (a, b, c, m) => (b + c >= m) ? a : f(a.concat([b + c]), c, b + c, m);
var fib = f([1, 1], 1, 1, 10);

Less pretty (94 chars)

f = (a, b, c, m) => (b + c >= m) ? a : f(a.concat([b + c]), c, b + c, m); f([1, 1], 1, 1, 10);

In the interest of providing an alternate from the while loops already given:

var f = (a, b, c, m) => (b + c >= m) ? a : f(a.concat([b + c]), c, b + c, m);
var fib = f([1, 1], 1, 1, 10);

Less pretty (55 chars)

m=10;f=(a,b,c)=>(b>=m)?a:f(a.concat(b),c,b+c);f([],1,1)
Source Link
Loading