A programming challenge, popularized by Jeff Atwood, that prints the numbers from 1 to 100, where multiples of three print "Fizz," multiples of five print "Buzz," and multiples of both three and five print "FizzBuzz."

learn more… | top users | synonyms

44
votes
3answers
4k views

Down with FizzBuzz… LOL

This post is the result of reading through and following the LOLCODE Specification 1.2, and writing and executing my code on compileonline.com. My "hello world" was going to be a fizzbuzz. I like it ...
27
votes
8answers
3k views

Which FizzBuzz is better, and why?

I was in an interview and the guy asked me to do the typical FizzBuzz question of printing numbers 1-100, but for each factor of 3 print Fizz, each factor of 5 print Buzz, and each factor of both ...
6
votes
2answers
79 views

Basic Imitation of C# Enumerable in VBA - or any other static class

Since implementing static classes in VBA actually seems possible I came up with an idea to try to imitate C#' Enumerable class (well, to some extent...). This is ...
8
votes
2answers
83 views

No more Fizzbuzz. How about Hello World instead?

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 ...
8
votes
1answer
65 views

Object-Oriented FizzBuzz in Ruby

I don't use Ruby on a regular basis, but I felt inspired to write an extensible, object-oriented version of FizzBuzz to sharpen my skills. I welcome all feedback. The main class: ...
1
vote
1answer
30 views

Ways to express proc inside a method

I'm interested in seeing different ways the proc can be expressed inside a method that takes args. This method is meant to be a sort of FizzBuzz that will dynamically replace "Fizz" or "Buzz" as well ...
22
votes
2answers
2k views

Tired of FizzBuzz yet?

There have been many FizzBuzz questions lately, and here is one more! Granted, it is pretty straightforward to do FizzBuzz with SQL using calculations. So instead, I'm going to do a FizzBuzz which ...
24
votes
1answer
507 views
+150

FizzBuzz in Brainfuck

Inspired a bit by a previous Brainfuck question and the recent fizzbuzz invasion, I decided to make FizzBuzz in Brainfuck. The code is entirely my own, except for the inclusion of the Printing a ...
8
votes
2answers
67 views

FizzBuzz in SQLite 2

This query performs a FizzBuzz in SQLite 2.8.17 without creating any tables or sprocs. First attempt: ...
5
votes
1answer
48 views

Multi-process FizzBuzz in Elixir

So I was playing with writing FizzBuzz in Elixir; this is my first, naive implementation: ...
13
votes
4answers
1k views

FizzBuzz in Ruby

I have this implementation of the FizzBuzz challenge in Ruby: ...
15
votes
2answers
339 views
12
votes
3answers
106 views

Haskell FizzBuzz with a type system

The core problem is simple enough, but I've developed a type system that I'm not sure about. The intention is, if the result is a number, calling ...
10
votes
2answers
76 views

VBuzz all fizzed up

I don't normally write vb.net code, and I would rather maintain a monstruous vb6 project than a simple vb.net one. There's something about fizzbuzz going on this weekend, that pushed me to write ...
4
votes
1answer
68 views

FizzBuzz - officially now in CLISP

I had to jump on the bandwagon for this one. The task does a great job of helping you learn a language you're unfamiliar with. So today I present you with my version of the infamous FizzBuzz game in ...
7
votes
3answers
143 views

Enterprise FizzBuzz in C++11

I've decided to write a C++ FizzBuzz with the focus on some new C++11 features, ridiculous optimizations and unit-testability. Are there improvement possibilities in those regards? ...
14
votes
1answer
212 views

16-bit FizzBuzz in x86 NASM assembly

Since this problem involves small numbers (particularly with a small loop count of 100), it's possible to ease the modulo operation setup by simply working with 16-bit and 8-bit registers: ...
12
votes
2answers
315 views

FizzBuzz in SQL--no loops

MS SQL Server, no loops. ;) ...
13
votes
1answer
280 views

Yet another FizzBuzz

Since today is apparently a good day for...unlikely FizzBuzz implementations, I decided to contribute another, this one in C++: ...
7
votes
5answers
507 views

FizzBuzz in Objective-C

In my quest for learning Objective-C, I have created the common FizzBuzz code in it. This is due to a suggestion/challenge from @nhgrif to re-implement anything he does in Swift in Objective-C. ...
12
votes
0answers
110 views

FizzBuzz in Forth

There are quite a large number of existing implementatons of FizzBuzz but I awoke this morning in a cold sweat with the terrible revelation that Code Review had no FizzBuzz implementation in Forth! ...
22
votes
8answers
2k views

The FizzBuzz challenge in Java 8 written in a short, readable and interesting way

I decided to take on the FizzBuzz challenge with as twist that I would use Java 8 concepts to make it a bit modular, yet still let it be a short, readable and understandable program. This in contrary ...
13
votes
5answers
923 views

Is this FizzBuzz Swift-y?

...
14
votes
3answers
961 views

FizzBuzz implementation using the ternary operator

This is my first time writing JAVA, and I'm trying to start off on the right track. Using my C++ knowledge, I was able to understand the syntax for the ternary operator, but I'm not sure how it ...
8
votes
4answers
2k views

Single line FizzBuzz solution in LINQ

Now FizzBuzz itself isn't a big challenge but I agree that it can be a good tool to see if someone can code or not. I wanted to practice my LINQ a little bit so here's my single line FizzBuzz ...
10
votes
2answers
530 views

“FIZZ BANG BUZZ!” 3,7,11 efficiency

I wrote a fizz buzz variation method in Python which prints "fizz", "bang", and "buzz" for 3, 7, and 11 respectively. ...
2
votes
1answer
67 views

Improving a Haskell FizzBuzz Solution

I wrote a solution to the popularized FizzBuzz problem in Haskell to see how a functional solution looks. I'm more or less happy with my solution, except for the definition of ...
9
votes
4answers
665 views
13
votes
4answers
785 views

First Scala FizzBuzz implementation

Would love some feedback on this. I'm coming from a Java background and kinda feel like I've just done exactly what I would do in Java. Is there a better way? ...
4
votes
1answer
159 views

Python Fizz Buzz, Acceptance Unit test

OK, maybe crazy overkill and a little silly, but why not? Here's a Python FizzBuzz Acceptance Test: ...
7
votes
2answers
197 views

Does this FizzBuzz code correctly follow SRP and unit-testing?

This is code for FizzBuzz. I have also hosted in on my GitHub. FizzChecker Tests ...
1
vote
2answers
139 views

How can I remove this for-loop in this competitive FizzBuzz code?

I'v written this code snippet that's part of a code competition. I want to do the trick without the for-loop, or simply find a way to optimize this code for speed. ...
6
votes
2answers
766 views

Fizz Buzz Bizz Fuzz in Java

This questions is originally from http://contestcoding.wordpress.com/2013/06/28/fizz-buzz-bizz-fuzz/. Print the integers from 1 to 100, but for the multiples of 3, print "Fizz" instead and ...
4
votes
1answer
83 views

PseudoBrain FizzBuzz Thoughts

Some recent discussions on this site involved the Fizz-Buzz game - I have never actually implemented this, but for the record this is what I put together: ...
8
votes
2answers
134 views

Batch-File FizzBuzz

I've never done a FizzBuzz before, so I decided I would. Please let me know what I could have done better. This is ran via a .bat file in Windows. ...
7
votes
6answers
459 views

Efficient FizzBuzz

I wrote the following Fizz Buzz program. How can I improve it or make it more efficient? ...
5
votes
1answer
473 views

OOP-style FizzBuzz program in PHP

I've tried to write a configurable OOP-style FizzBuzz program in PHP for learning purposes. I hope everything is quite easy to understand. What do you think of the overall architecture? Are OOP ...
2
votes
2answers
151 views

Code review request for fizz buzz

Okay code reviewers, I need you to make my FizzBuzz code even better. Any suggestions for improvement, optimizations, etc. ...
5
votes
3answers
353 views

How can I improve this Haskell code?

This code solves the problem of FizzBuzz. Is it possible in any way to improve it? ...
5
votes
4answers
728 views

What do you think of my Recursive FizzBuzz?

I wanted to see if I fully understood recursion so I attempted the FizzBuzz challenge and applied recursion to it. Did I do it correctly? Is this good code? Is there a more efficient way of doing ...
6
votes
5answers
2k views

Writing FizzBuzz

First of all, I came up with that question on SO already. But I am offered different solution which are "better" in some ways. The goal is to improve this specific version, not to create another ...
5
votes
1answer
800 views

Higher-order FizzBuzz in Clojure

Help me make it better. Requirement: support arbitrary number of factors, not just 3 & 5. ...
4
votes
4answers
5k views

FizzBuzz implementation

The common FizzBuzz implementation I saw is using a check for % 15 for printing "FizzBuzz" Would you let me know if there is anything wrong / better with this approach? ...
11
votes
2answers
8k views

Ultra-Beginner Python FizzBuzz … Am I missing something?

I just started programming in Python this morning, and it is (more or less) my first programming language. I've done a bit of programming before, but never really did much except for "Hello World" in ...
6
votes
2answers
1k views

Ways to improve my coding test FizzBuzz solution for a TDD role?

I had an interview recently where I was asked to produce the traditional FizzBuzz solution: Output a list of numbers from 1 to 100. For all multiples of 3 and 5, the number is replaced ...
7
votes
2answers
1k views

Fizz Buzz interview question code

Reading Jeff Atwood's "Why Can't Programmers.. Program?" led me to think that almost all of the solutions would not be something I would want in my own code-base. The Fizz Buzz program specification ...
7
votes
6answers
2k views

Pythonic FizzBuzz Problem

Below are two solutions to the Fizz Buzz problem in Python. Which one of these is more "Pythonic" and why is it more "Pythonic" than the other? Solution One: ...