-
-
Save remy/961583 to your computer and use it in GitHub Desktop.
i=0;do console.log(++i%15?i%3?i%5?i:'buzz':'fizz':'fizzbuzz');while(i<100) |
Yours only goes to 99 - but easily fixed: ++i<=100
and you're still 2 characters less.
Passes crown
ok, so this is obviously not the " smallest", but I'm out to lunch and can't really play : / https://gist.github.com/838765
@remy: ++i<=100
, or ++i<101
which is even shorter :)
while I'm out to lunch... Hehehe... Can someone try this using node repl... Without the console.log()?
I was out today, but I'm back now. Here's my version, weighing in at 64 characters.
for(i=0;i++<100;)console.log((i%3?'':'Fizz')+(i%5?'':'Buzz')||i)
I think The Cowboy just hit that one out of the park (note that you want 101 and not 100 - because you're missing the last fizzbuzz - still, you win!)
My example counts from 1 to 100!
Doh!
Do I win? No. 63 chars
i=100;while(i--)console.log((i%3?'':'Fizz')+(i%5?'':'Buzz')||i)
@ryanseddon You get an extra FizzBuzz at 0.
FWIW, for(init;condition;)
will always be one character less than init;while(condition)
.. but still, I'd imagine that per the rules, you have to count upwards, from 1 to 100.
62 chars jsconsole output
for(i=0;++i<101;console.log(i%5?f||i:f+'Buzz'))f=i%3?'':'Fizz'
Updated my comment :)