Questions tagged [fizzbuzz]

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

Filter by
Sorted by
Tagged with
7
votes
2answers
116 views

FizzBuzzWoofFooBar - follow-up

I took all your suggestions to heart and I think it improved the code a lot. The Map got it's own typedef: ...
6
votes
2answers
602 views

FizzBuzz-like Assignment

I have an assignment for my Java programming class that is kind of an expanded FizzBuzz-like question: Write a program that iterates through numbers from 0 to 113 using a loop. Print the numbers,...
12
votes
1answer
342 views

FizzBuzzWoofFooBar

My C++ was starting to get rusty and I never touched some of the newer features. Reason enough to try something simple and make it overly complicated: FizzBuzz with bonus features. For now we'll call ...
25
votes
1answer
862 views

Ultimate FizzBuzz

Swift's SequenceType is a useful means of generating a sequence of values, and it makes it particularly useful iterate over these values. I don't really have much ...
3
votes
2answers
349 views

FIZZ BUZZ -challenge program with adjustable intervals

This is again a solution to the codeEval challenge #1. It was accepted by codeEval, but please let me know if I can improve it anyway somehow? ...
4
votes
2answers
142 views

Reducing memory usage for FizzBuzz in R

I've been trying all night to get my fizzbuzz to use below 20 MB of RAM but I can't seem to get it much smaller than this. ...
5
votes
3answers
2k views

Java FizzString

I am testing what knowledge I have with the FizzBuzz tests in Java. This is the one I just completed: Given a string str, if the string starts with "f" return "Fizz". If the string ends with "b" ...
6
votes
1answer
160 views

General Fizzbuzz

I'm learning Rust now and created a program to solve the task General Fizzbuzz on Rosetta Code. For example, given: 20 3 Fizz 5 Buzz 7 Baxx where the first line ...
4
votes
2answers
158 views

FizzBuzz Kickoff

My first FizzBuzz question (well, I asked, then deleted, one previously), and my very first VB.NET question. ...
2
votes
2answers
144 views

Improving the efficiency of my FizzBuzz algorithm [closed]

I worked on an exercise from codewars, which is a variation of the popular fizzbuzz game. (If the link doesn't work, you may need to reload the page.) In this variation, I'm supposed to find the sum ...
8
votes
3answers
1k 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 ...
5
votes
1answer
455 views

Fizzbuzz in Python

I'm new to Python and wondering what can be improved with the following super novice program - in terms of the solution and code style etc. test_fizzbuzz.py ...
12
votes
2answers
442 views

FizzBuzz Challenge

This bit of code is a small game to see how long you play a game of FizzBuzz without messing up. Code: The top of the code: ...
5
votes
1answer
660 views

FizzBuzz from a file

This was found on CodeEval. Challenge: Write a program that prints out the final series of numbers where those divisible by X, Y and both are replaced by “F” for fizz, “B” for buzz and “FB” for fizz ...
8
votes
2answers
342 views

FizzBuzz from a casual rubyist

As a casual Rubyist I am mainly interested, how ideomatic my solution is. ...
22
votes
5answers
7k views

FizzBuzz in Ruby

I have this implementation of the FizzBuzz challenge in Ruby: ...
3
votes
1answer
201 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 ...
16
votes
4answers
1k views

Extensible and testable FizzBuzz

There seem no end to fizzbuzz implementations. Something I rarely see is an implementation that's easy to extend with more name-divisor pairs. Another thing that usually annoys me is the lack of ...
1
vote
2answers
130 views

FizzBuzz Solution Rags to Different Rags [closed]

I took some code and reviewed it, but it got me thinking, so I re wrote the code a little bit and would like to ask what you think of it and why it's bad to do this, even though it works. ...
17
votes
2answers
887 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 ...
12
votes
8answers
3k 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 ...
10
votes
2answers
839 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 ...
5
votes
1answer
329 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
735 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
878 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 ...
3
votes
2answers
1k 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
1answer
663 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 ...
13
votes
3answers
424 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 num $ fizzBuzz 16,...
6
votes
5answers
4k 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 one....
13
votes
1answer
359 views

Multi-process FizzBuzz in Elixir

So I was playing with writing FizzBuzz in Elixir; this is my first, naive implementation: ...
9
votes
2answers
639 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 both ...
10
votes
1answer
387 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
89 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 ...
6
votes
2answers
861 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 ...
11
votes
2answers
321 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 this:...
7
votes
3answers
659 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? ...
9
votes
2answers
183 views

FizzBuzz in SQLite 2

This query performs a FizzBuzz in SQLite 2.8.17 without creating any tables or sprocs. First attempt: ...
40
votes
8answers
9k 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 ...
19
votes
2answers
639 views

FizzBuzz in Commodore Basic

...
31
votes
3answers
2k 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
5answers
3k 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. <...
15
votes
1answer
1k views

Yet another FizzBuzz

Since today is apparently a good day for...unlikely FizzBuzz implementations, I decided to contribute another, this one in C++: ...
21
votes
2answers
57k 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 ...
12
votes
4answers
1k views
9
votes
2answers
556 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. ...
11
votes
2answers
794 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. ...
0
votes
2answers
294 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. ...
4
votes
1answer
2k 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: ...
6
votes
2answers
5k 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 with ...
4
votes
1answer
1k views

Higher-order FizzBuzz in Clojure

Help me make it better. Requirement: support arbitrary number of factors, not just 3 & 5. ...