Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
javascript fizzbuzz solution
// initialize string override sequence
var j,sp = {
s: String.prototype.toString,
l: function(){console.log(this.s());}
}, d=['F','B'], fd=function(l) {sp[l]=function(){return l+this;};};
// splines.reticulate
fd(d[0]);
fd(d[1]);
for(j in sp)
String.prototype[j] = sp[j];
// spin the flux capaciter
var s=1,e=100,i="izz",u="uzz";
for(j=s;j<e+1;++j) {
var rs = j;
while(rs>9)
for (var k=0,sr=rs.toString(),rs=0;k<sr.length;++k) {
rs+=parseInt(sr[k],10);
}
(function(j, i, u) {
if (/[369]/.exec(rs)) return u.F()+(/[05]$/.exec(j)?i.B():'');
else if (j%5===0) return i.B();
else return j.toString();
})(j, u, i).l();
}
@devnill

This comment has been minimized.

Copy link

@devnill devnill commented May 18, 2012

var j,sp={s:String.prototype.toString,l:function(){console.log(this.s());}},d=['F','B'],fd=function(l){sp[l]=function(){return l+this;};};fd(d[0]);fd(d[1]);for(j in sp)
String.prototype[j]=sp[j];var s=1,e=100,i="izz",u="uzz";for(j=s;j<e+1;++j){var rs=j;while(rs>9)
for(var k=0,sr=rs.toString(),rs=0;k<sr.length;++k){rs+=parseInt(sr[k],10);}
(function(j,i,u){if(/[369]/.exec(rs))return u.F()+(/[05]$/.exec(j)?i.B():'');else if(j%5===0)return i.B();else return j.toString();})(j,u,i).l();}

@Benhgift

This comment has been minimized.

Copy link

@Benhgift Benhgift commented May 18, 2012

Wow. Win.

@tyrelsouza

This comment has been minimized.

Copy link

@tyrelsouza tyrelsouza commented May 18, 2012

Wow, this is a very easy to read.

@chrisinajar

This comment has been minimized.

Copy link
Owner Author

@chrisinajar chrisinajar commented May 18, 2012

Yeah, I even commented the code.

@Benhgift

This comment has been minimized.

Copy link

@Benhgift Benhgift commented May 18, 2012

Reticulating Splines...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.