Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

0
votes
1answer
60 views

Fizzbuzz but without if

Code first, elaboration later: ...
5
votes
1answer
145 views

Unit-testable C# FizzBuzz

To support a demonstration I'm going to be doing, I need a short C# program that can be unit tested. I decided to make a FizzBuzz split into a few methods: ...
3
votes
3answers
97 views

fizzbu| - Fizzbuzz with dynamic height

Here is a variation on a theme: fizzbuzz. After providing this answer recently, I decided to practice some VueJS skills with outputting the values and conditionally applying styles based on the value. ...
18
votes
7answers
8k views

FizzBuzz in Javascript

I'm sure everyone here knows what FizzBuzz is. I would like constructive criticism for my solution. I'm a beginner to programming as a whole and this isn't my first solution, but it's what I think is ...
0
votes
1answer
60 views

FizzBuzz in Rust [closed]

I want to make fizzbuzz method return the resolved value and then pass it to println!. Been having quite a problem with &str vs String. Wanted to use &str as return value as it's immutable so ...
1
vote
1answer
64 views

FizzBuzz with Lambda Expressions in Java

I wanted to create a FizzBuzz in Java that is supposed to be open for extension. So the initial problem is the good old, if divisible by 3 print fizz, if divisible by 5 print buzz, if divisible by ...
3
votes
1answer
86 views

FizzBuzz in FreezeFlame

This is the first question for this language, and I decided I would do a FizzBuzz. I used a template literal as a proof of concept, same goes for the pipe (|>). ...
4
votes
1answer
144 views

Solution for sum of all fizzbuzz numbers in a given range

The number fizz buzz is composed of two numbers that are fizz and buzz. fizz represents the numbers that are divisible by 3 and buzz are the numbers that are divisible by 5. combining both fizz buzz ...
4
votes
1answer
118 views

FizzBuzz in Common Lisp

Where I stand on Lisp So, Lisp. It's been on my radar for years and I'm finally getting around to learning it. The syntax is foreign but I find I'm having the most difficulty in the areas of ...
11
votes
1answer
145 views

A Structured FizzBuzz

Warning Wall of text, little bit of code. This question is about as much as introducing the language as it is about whether or not I still know how to write the language. Introduction Programmable ...
2
votes
3answers
476 views

FizzBuzz implementation in Java without modulus operator

I was trying to implement FizzBuzz without modulus operator. Areas of concern: inner for loop maybe not needed? seq[] array maybe not needed? ...
4
votes
3answers
541 views

Fizz Buzz Test Driven Development

Task: Create the Fizz Buzz game using Test Driven Developoment. Print the correct word for range 1-100. The implementation: ...
1
vote
1answer
290 views

Over-Engineered FizzBuzz, ’17-style

In my first question I tried to show “real” coding concerns while still keeping the implementation brute simple; using a loop over data rather than a string of separate testing statements, isolating ...
12
votes
4answers
2k views

FizzBuzz, ’17-style

My exercise is to write the Fizz Buzz problem with the following in mind: Use the latest up-to-date style and best practices for a C++17 compiler. Don’t just show that I can write a loop. Rather, ...
6
votes
1answer
149 views

x86 FASM assembly Reverse FizzBuzz

This program counts down from 100 to 1 and: If the current number is a multiple of 3 it prints "Fizz" instead of the number If it is a multiple of 5 it prints "Buzz" instead of the number If it is a ...
3
votes
3answers
153 views

Attempt at the Most dynamic FizzBuzz possible in Java

I was trying to come up with the most dynamic fizzbuzz answer I could.. and well, this is what I came up with: ...
4
votes
1answer
118 views

FizzBuzz in F# with functional programming

Learning F#, created a somewhat elaborate fizzbuzz-builder implementation to see if I'm starting to "get" F# and thinking functionally: ...
7
votes
0answers
168 views

Optimized FizzBuzz in brainfuck

While looking for brainfuck related things, I came across Simon Forsberg's FizzBuzz in Brainfuck and cheekily commented a link to my own brainfuck FizzBuzz answer over on PPCG. He suggested I should ...
2
votes
5answers
179 views

Expandable fizz buzz javascript

I've been learning JavaScript for a few weeks and thought to give the ol' fizzbuzz another try. My goal was for expandability. In other words, I wanted to be able to add more keywords without having ...
5
votes
2answers
184 views

General FizzBuzz in Scala

I wanted to create a FizzBuzz implementation that both showcases the strengths of Scala (Functional paradigm and collections) and is general enough to anticipate the typical interview follow-up ...
3
votes
1answer
105 views

FizzBuzz in Befunge93

The intro Yesterday I learned of the existence of Befunge. See my (sort of) related question about a Befunge interpreter in Python. And it made me want to learn the language, and what do programmers ...
3
votes
3answers
101 views

FizzBuzz with debugging output

This is a pretty simple FizzBuzz variant. I'm more interested in my use of C (this is my first bit of C code) than I am in my actual FizzBuzz implementation, although I'm always open to suggestions. ...
2
votes
2answers
92 views

Maintainable and Adaptable FizzBuzz implementation

Something I haven't often seen in FizzBuzz implementation is a focus on making it flexible and maintainable. I have attempted to create a version that prioritizes these, such as by making it easier to ...
5
votes
2answers
221 views

Game about choosing a “boom number” and then count one by one (version 2)

I posted this question two days ago and received some helpful answers. I was advised to try to incorporate the suggestions into the code and also to try to code the steps of the "game task" that I ...
5
votes
3answers
531 views

Game about choosing a “boom number” and then count one by one

The goal is this "simple game". The game is all about that you choose a "boom number" and then count one by one from 1. Every time that the player hits a number that can be divided by the "...
0
votes
2answers
106 views

Is this FizzBuzz code idiomatic Groovy?

I'm new to Groovy but have some experience with Java, C and Python. I'd appreciate your feedback on Groovy style and features in this FizzBuzz code. Review Checklist Is it idiomatic Groovy code? Can ...
6
votes
2answers
130 views

Fizzbuzz some Fibonacci numbers

I was teaching some new people in office a bit of COBOL, so I threw together this exercise where they had to write a program that would generate the first 10 numbers of a Fibonacci suite and then test ...
3
votes
1answer
126 views

Ruby & OOP: FizzBuzz Game

I would like a more elegant solution for this problem, I think the FizzBuzzArrayBuilder class is not used properly. Also can those ...
3
votes
0answers
232 views

Javascript FizzBuzz and Behavior-Driven Development Using Mocha and Chai

I am currently getting closely acquainted with Behavior-Driven Development. Could someone tell me how I am doing with the Fizzbuzz program below? I am interested in both improving the Javascipt code ...
3
votes
0answers
72 views

FizzBuzz - A quartet of solutions

Since the FizzBuzz challenge is about developing ideas, I've added a third test case for which I chose divisibility by 7 and its accompanying tag "Go". This tag was purposely given a length other ...
3
votes
3answers
84 views

Sequence program (FizzBuzz-like)

I have wrote a program which prints sequence of numbers. But if number is divisible by 4 it prints x if divisible by 7 it prints ...
2
votes
1answer
686 views

Fizzbuzz function in PHP

Most implementations of FizzBuzz that I've seen rely on 3 modulus operations. Mine does two and a Boolean. (Not implying one is better, just different) I understand that FizzBuzz is supposedly not to ...
1
vote
3answers
696 views

General FizzBuzz in Java

I have this generalization of FizzBuzz in Java: ...
9
votes
9answers
2k views

Beginner FizzBuzz in Python

This is my first attempt at solving Fizzbuzz. I've always been pretty weak at algorithms, so I'm trying to improve. Specific feedback on performance would be appreciated. ...
7
votes
1answer
1k views

What's wrong with this FizzBuzz?

The rules are unsurprisingly: Write a program that prints the numbers from 0 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For ...
18
votes
10answers
7k views

Yet another boring FizzBuzz

I've just finished my first program written in Java. It's a simple, boring, yet well-known FizzBuzz challenge where you have to: Write a program that prints the numbers from 1 to 100. But for ...
6
votes
2answers
153 views

FizzBuzz in MIPS, unneccessary branches

I'm just starting out in MIPS (as is evident by the fact that I'm writing a FizzBuzz program), and my program runs fine and gives the desired output, but I feel like there is a way to do it without as ...
3
votes
2answers
665 views

My attempt at FizzBuzz (Python 3)

Is this a good solution for FizzBuzz? What can I do better? ...
5
votes
2answers
269 views

Yet another FizzBuzz in Haskell

Time for the most original question of the year: writing a FizzBuzz in Haskell! So here is what I came up with: ...
8
votes
2answers
688 views

Fizz, Buzz, or FizzBuzz?

I was messing around online at work the other day when our phone systems went down. I came across the R programming language. Now I'm not guru with programming by ...
9
votes
6answers
4k views

FizzBuzz Implementation in Java

Fairly new to learning interview questions and I saw this one and gave it a shot. I would very much appreciate some constructive criticism of how I went about it and what you would tell me if you were ...
3
votes
1answer
243 views

FizzBuzz in Scala

As the title suggests, this is my FizzBuzz implementation in Scala. I started learning Scala (and functional programming in general) in small steps about two months ago, and one recent assignment ...
6
votes
5answers
1k views

MontyPython (Fizzbuzz)

This is an iterative review. The previous iteration can be found here. I've now been programming in python for all of 6 hours. This is probably my last iteration of FizzBuzz. Thoughts? ...
11
votes
3answers
2k views

RattleHiss (fizzbuzz in python)

This is an iterative review. The previous iteration can be found here. The next iteration can be found here I've now been programming in python for all of 4 hours. At 70 lines it's rather verbose ...
15
votes
3answers
3k views

class fizzbuzz():

This is now an iterative review. The next iteration can be found here. Yep. Fizzbuzz in Python. I've been coding in Python for all of 90 minutes. Thoughts? Program Flow Take a ...
6
votes
4answers
252 views

Fizzbuzz of course

My second attempt with vb.net - I tried taking the advice from yesterday's question into consideration, but I did not try using LINQ. You know the drill: A programming challenge that prints the ...
8
votes
3answers
135 views

A guarded FizzBuzz

Vogel612 and I decided to take a shot at the StackSTV challenge in Haskell. This is part of the CRitter Collaboration challenge. Except I don't know any Haskell. So let's try a FizzBuzz first! I'm ...
10
votes
1answer
107 views

FizzBuzz in CSS

So someone challenged me to write FizzBuzz using CSS only. This was the best I could come up with, but I think the "divisible by 5, not divisible by 3" CSS rule is a bit clunky. So I'm looking for ...
8
votes
3answers
140 views

print(fizz..buzz)

I couldn't help but notice we didn't have a FizzBuzz in lua yet. I've always wanted to take a shot at Lua, so here goes nothing. Code: ...
3
votes
1answer
681 views

Ruby FizzBuzz solution with Rspec test

My code makes the four tests pass, but I'm worried I'm missing something. Is the code too simple and not encompassing enough? I'm just beginning to learn so any feedback is welcome! Here's the Rspec ...