Code Golf

Competitive code minification for fun.

  • Share it.

For the uninitiated, Code Golf is the practice of solving a problem using as few characters as possible. The working solution with the least characters wins, regardless of other measures of quality. Some programmers value concise code, however code golf is takes this to the extreme, and is just for fun.

This short post is a play-along challenge to anyone who knows any programming language. Have a go at this problem, and post your version (and a character count) in the comments. Any printable language is allowed, the wackier the better.

The problem: FizzBuzz
Show integers 1 to 100, but replace multiples of 3 with “Fizz”, multiples of 5 with “Buzz” and multiples of both with “FizzBuzz”.

Here are my attempts:


129 characters

class X {static void Main(){for(int n=1;n<101;n++)System.Console.WriteLine(n%15<1?"FizzBuzz":n%3<1?"Fizz":n%5<1?"Buzz":n+"");}}


73 characters


Let’s see what you can come up with…