Skip to content

Instantly share code, notes, and snippets.

@bbog
Created May 15, 2015 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bbog/61ca2b878071c0df7167 to your computer and use it in GitHub Desktop.
Save bbog/61ca2b878071c0df7167 to your computer and use it in GitHub Desktop.
function fizzbuzz(n){
var ft='Fizz',bt='Buzz',f=(n%3==0),b=(n%5==0);
return (f&&b)?ft+bt:f?ft:b?bt:n;
}
@bbog
Copy link
Author

bbog commented May 15, 2015

function fizzbuzz(n){
x='Fizz'
y='Buzz'
f=n%3==0
b=n%5==0
return f&&b?x+y:f?x:b?y:n}

@bbog
Copy link
Author

bbog commented May 15, 2015

function fizzbuzz(n){
x='Fizz'
y='Buzz'
f=n%3<1
b=n%5<1
return f&&b?x+y:f?x:b?y:n}

@bbog
Copy link
Author

bbog commented May 15, 2015

f='Fizz'
b='Buzz'
return n%3 ? n%5 ? n : b : n%5 ? f : f+b

@bbog
Copy link
Author

bbog commented May 15, 2015

function fizzbuzz(n){
f='Fizz'
b='Buzz'
return n%3 ? n%5 ? n : b : n%5 ? f : f+b
}

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