A < 140 byte solution to the classic "FizzBuzz" problem.
The Fizz Buzz problem I'll work with is defined as follows:
Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz.” For numbers which are multiples of both three and five print “FizzBuzz.”
For more information, see the page at http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html.
@danbeam on Twitter previously solved this problem in 84 Bytes. His solution was as follows:
for(i=0;++i<101;)console.log(!(i%15)&&"fizzbuzz"||!(i%3)&&"fizz"||!(i%5)&&"buzz"||i)
My solution solves it in 67. Beat that, ninja's :)
This is my first 140byt.es entry - I wasn't aware the function definition was included in the byte count sorry. And the function only leaks to the global scope through the application of a closure for the variable 'i' - surely that doesn't count? Nicely done lopping it down to 77 :)