Skip to content

Instantly share code, notes, and snippets.

@cloneko
Last active August 29, 2015 14:02
Show Gist options
  • Save cloneko/4d7f8db08c53c7485457 to your computer and use it in GitHub Desktop.
Save cloneko/4d7f8db08c53c7485457 to your computer and use it in GitHub Desktop.
ふと思い付いた駄目な感じのfizzbuzz
var end = 150;
for (var i = 0; i <= end;i++){
console.log(function(){
var ret = ''
// Fizz
ret += function(){
return (i % 3) == 0 ? 'Fizz' : '';
}();
// Buzz
ret += function(){
return (i % 5) == 0 ? 'Buzz' : '';
}();
return ret == '' ? i : ret;
}());
}
@cloneko
Copy link
Author

cloneko commented Jun 18, 2014

node.jsで試した。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment