FizzBuzz in multiple languages
Shell Makefile COBOL Visual Basic C Fortran Other
Permalink
Failed to load latest commit information.
sh6-bug sh6-bug updated again Dec 17, 2016
README.md fizzbuzz-c now has 86 entries Feb 20, 2017
TODO.md TODO: Frink Feb 18, 2017
expected-output.txt Initial checkin Apr 10, 2012
fizzbuzz.a68 Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.adb Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.awk Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.b Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.bas Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.bash Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.bc Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.c Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.cat Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.clisp Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.clojure Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.cob Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.cpp Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.crystal Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.cs Update installation and compilation for fizzbuzz.cs (C#) Nov 15, 2016
fizzbuzz.csh Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.curl Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.d Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.dart Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.elisp Add Emacs Lisp Jan 5, 2017
fizzbuzz.erl Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.f Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.f66 Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.f90 Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.fal Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.fish Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.fizzbuzz Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.fs Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.gcc Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.gdb Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.go Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.gpt Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.groovy Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.guile Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.hodor Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.hs Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.hx Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.icn Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.io Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.java Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.jl Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.js Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.l Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.lly Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.logo Workaround for fizzbuzz.logo failure Dec 18, 2016
fizzbuzz.lol Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.lua Update installation instructions for Lua Nov 15, 2016
fizzbuzz.m Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.m4 Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.mk Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.mod Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.myr Add Myrddin (fizzbuzz.myr) Jan 1, 2017
fizzbuzz.nim Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.nodejs Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.nqp Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.octave Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.pas Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.php Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.pike Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.pl Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.pl6 Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.ps Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.pure Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.py Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.py3 Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.r Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.ratfor Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.rb Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.rc Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.rexx Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.rs Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.scala Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.setl Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.sh Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.sh6 Work around sh6 failure by using osh Jan 1, 2017
fizzbuzz.sim Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.sqlite3 Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.squirrel Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.st Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.swift Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.sx Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.tab Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.tail Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.tcl Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.vala Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.vb Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.vg Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.vim Large update for Ubuntu 16.10 Dec 2, 2016
fizzbuzz.ws Add "comments" to fizzbuzz.ws Feb 1, 2015
fizzbuzz.zsh Add fizzbuzz.zsh Dec 20, 2016
install-prereqs Large update for Ubuntu 16.10 Dec 2, 2016
verify Add Emacs Lisp Jan 5, 2017

README.md

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 (86 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 (90 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. It works on my system, x86_64 Ubuntu 16.10, with required packages installed as documented in each source file.

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.