Home

Awesome

FizzBuzz is a nearly trivial programming exercise, sometimes used in job interviews to weed out candidates who say they can program but really can't.

References:

The requirements are simple:

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".

In my fizzbuz-c project I present multiple (138 at last count) C solutions.

NOTE : This is not intended as a collaborative project. It is my own personal playground. A few people have submitted pull requests for languages I haven't covered, which I certainly appreciate, but I won't be accepting them. If you're interested in collaborating on something similar, see Rosetta Code. Bug reports are quite welcome.

Here I present multiple implementations, one in each language. The current set of languages (111 of them) is:

Many of these are inspired by http://99-bottles-of-beer.net/.

tail and cat are simply the standard Unix/Linux utilities, not real scripting languages. The cat implementation in particular is an ugly cheat, depending on the existence of the expected-output.txt file.

JavaScript and Node.js aren't really distinct languages, but Node.js is a sufficiently different environment than plain JavaScript that I thought it was worth having both.

curl is a URL transfer utility, not a programming language. fizzbuzz.curl, like fizzbuzz.cat, depends on the existence of expected-output.txt, but on this GitHub project page rather than in the current directory. It also requires an Internet connection.

The verify script executes each program and confirms that its output is correct. All programs pass on Ubuntu 22.04.4 LTS.

fizzbuzz.b is not tested with an actual B compiler; see that file for details.

fizzbuzz.sh6 failed due to a problem with the external goto command. I'm in touch with the maintainer to (I hope) get a fix for this. See the sh6-bug subdirectory for details. (For now I've worked around this problem by using osh rather than sh6. osh is an enhanced implementation of sh6 that has goto as a built-in command.)

The Whitespace web page is currently down, so I'm using the Perl implementation from here. I'll update the "comments" in the source file later (that's difficult to do, since I have to preserve existing whitespace).

I'm keeping an informal list of languages I intend to add in TODO.md.

Do not take this too seriously.