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

13
votes
2answers
627 views

FizzBuzz example in Python for game manual

I'm developing an implementation of the FizzBuzz game as part of an edutainment game for a retro video game platform. In its manual, I want to mention the history of writing a bot for the FizzBuzz ...
10
votes
8answers
1k views

FizzBuzz using switches

I'm learning about control structures now, and I want to see if I'm doing this as cleanly and efficiently as possible. Seems like there should be a less... verbose way of writing the ...
5
votes
1answer
115 views

The Functional FizzBuzz Kata

I run a coding dojo at work. For one session I'm to showing that you can use a kata to get into a new language. I'm using the FizzBuzz Kata to to show F# (and JavaScript) because it is short. The ...
8
votes
2answers
448 views

The Scripted FizzBuzz Kata

I run a coding dojo at work. for one session I'm to showing that you can use a kata to get into a new language. I'm using the FizzBuzz Kata to show JavaScript (and F#) because it is short. The ...
7
votes
2answers
347 views

FizzBuzz with user input variables

Yes, another FizzBuzz! I know you guys may be tired of these but I think it's a tradition stepping stone for beginners on this site. Here are some notes on my thinking: I tried to keep it as ...
10
votes
3answers
92 views

FizzBuzz vs. FortRan

In keeping with using FizzBuzz as an introduction to a language, I present FizzBuzz with a Fortran95 twist: For multiples of 3, print Fort, and for 5's multiples ...
2
votes
2answers
102 views

Fizz Buzz in JS

This is a simple JavaScript Fizz Buzz solution based on a Codecademy exercise. I refactored it down a few lines after seeing these implementations. I wanted to post here and see what else I can ...
7
votes
3answers
881 views

Simple FizzBuzz

I wanted to try FizzBuzz, but to do it in the most efficient way. I think this method employs most of the concepts I learned here. Is there anything unaccounted for? A sprinkle of Swing since that's ...
6
votes
1answer
71 views

Wrapping JS file in function, and assigning that function to a variable

I've been reading about wrapping JS files in functions to call them on load, etc. I also was looking at namespaces and how to avoid collisions with functions/objects/variables of the same name. What ...
58
votes
3answers
5k views

Down with FizzBuzz… LOL

This post is the result of reading through and following the LOLCODE Specification 1.2 ("smoking the manual", right?), and writing and executing my code on compileonline.com. My "hello world" was ...
30
votes
9answers
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
114 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
107 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 ...
10
votes
1answer
94 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
35 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 ...
27
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 ...
32
votes
1answer
899 views

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
78 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
70 views

Multi-process FizzBuzz in Elixir

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

FizzBuzz in Ruby

I have this implementation of the FizzBuzz challenge in Ruby: ...
15
votes
2answers
356 views
12
votes
3answers
153 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
94 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 ...
5
votes
3answers
113 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
172 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? ...
16
votes
1answer
388 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
368 views

FizzBuzz in SQL--no loops

MS SQL Server, no loops. ;) ...
13
votes
1answer
324 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
667 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. ...
18
votes
1answer
346 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! ...
26
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
1k views

Is this FizzBuzz Swift-y?

...
15
votes
3answers
1k 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
3k 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
571 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
81 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 ...
10
votes
4answers
757 views
14
votes
5answers
966 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
208 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
238 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
157 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
1k 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
94 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
154 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
5answers
525 views

Efficient FizzBuzz

I wrote the following Fizz Buzz program. How can I improve it or make it more efficient? ...
5
votes
1answer
568 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
157 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
391 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
890 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 ...