Ask HN: What is the shortest fizzbuzz code you can write?

https://news.ycombinator.com/item?id=4292833
by mappum • 14 years ago
1 0 14 years ago

Any language is viable, and the snippet must be able to work independently. How few characters can you get it?

I narrowed down my JS fizzbuzz to 64 characters:

for(i=0;i++<100;)console.log((i%3?'':'Fizz')+(i%5?'':'Buzz')||i)

It uses a global though, Douglas Crockford wouldn't like it.

Related Stories

Loading related stories...

Source preview

news.ycombinator.com