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
1
vote
0answers
42 views

FizzBuzz in OCaml

I've tried to write a version of this problem where it's easy to adapt if there's an additional pair (e. g. Say Bazz for 7). Looking for general advice. ...
0
votes
1answer
98 views

FizzBuzz Optimisation | Modulus vs Decrement Operator Performance

This is not the typical debate in FizzBuzz code about how to handle repeated if statement. I believe that it is a matter of personal preference. I am here to ask about the choice of repeated ...
3
votes
2answers
81 views

Branchless Fizbuzz in Posix C (no if-s, ternaries, switches or loops)

Yesterday when I was showering I was thinking of branchless programming and a thought occurred to me, whether it's possible to write a branchless solution of the Fizbuzz problem. The constraints I put ...
49
votes
2answers
3k 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: $$\dfrac{\...
2
votes
0answers
65 views

FizzBuzz JSON via Unix socket (Go)

At heart, this program is just the basic "FizzBuzz" program. However, the program was pushed further, by making it a client-server via Unix Socket: Server run, and listening on a socket. ...
5
votes
3answers
1k views

FizzBuzz, but with provided start and end of sequence, results stored in array, and a separate function to convert integers to strings

To learn C, I'm doing the traditional FizzBuzz challenge with extra restrictions: The start and end of sequence is provided by the user Instead of directly printing the results, the results must be ...
4
votes
1answer
152 views

FizzBuzz in Vyxal

I've created this code in the golfing language Vyxal to do FizzBuzz: ...
7
votes
3answers
2k views

Fizzbuzz in C lang

This is the first time I have recoded in C for several years and I would like to know how clean my code is. ...
2
votes
1answer
80 views

FizzBuzz in arm64

I made a FizzBuzz program in arm64; I print out the values in hex instead of decimal. This was the first arm64 program I made and I'm looking for advice on how I can improve it. The code to print out ...
0
votes
1answer
105 views

Fizz Buzz function that returns an array [closed]

I am a newbie to JS and I am working on a FizzBuzz challenge. Below is what I have tried. Essentially when the function takes a value then it would iterate from 1 up to the value and an array would ...
2
votes
2answers
184 views

Fizzbuzz questions - job interview rejected [closed]

I have done some programming tasks as a part of my candidacy for a web development apprenticeship. Unfortunately, my application was rejected as the hiring manager "didn't like my codes." I ...
11
votes
3answers
2k views

Logs 'Fizz' for multiples of three, 'Buzz', for multiples of 5, and 'Fizz Buzz' for multiples of 3 & 5

I'm new to coding and have been directed here from Stack Overflow. As I'm new to coding, I'm not entirely sure if my program works completely, but I think it does. I'm looking for suggestions on how ...
3
votes
5answers
1k views

Small FizzBuzz program

After watching this video by Tom Scott, I decided to make a program that follows that idea. This is what I came up with: ...
24
votes
2answers
896 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! ...
5
votes
2answers
2k views

My attempt at FizzBuzz (Python 3)

Is this a good solution for FizzBuzz? What can I do better? ...
9
votes
2answers
1k 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 ...
123
votes
3answers
12k 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 ...
1
vote
5answers
151 views

FizzBuzz solution

I'm preparing for junior developer interviews and am trying to come up with a more interesting/versatile solution to FizzBuzz than I've done in the past. Do you have any ideas of how I might DRY this ...
5
votes
2answers
131 views

FizzBuzz game, open to any critiques

I made this FizzBuzz game for my college class and it's kind of ridiculous, but is suppose to demonstrate chain of command so writing it in a little forloop was out of the question. In case you don't ...
1
vote
3answers
208 views

Fizzbuzz in C for console

I imagine I get a minuscule performance improvement by doing the %3 as a branch off the %5 rather than the other way round or as an if '%15'. Am I correct about that? (I know there is no practical ...
3
votes
3answers
401 views

Functional programming FizzBuzz

I tried to code the fizzbuzz program following the functional programming rules in javascript. Please check my code and give feedback. thank you. ...
21
votes
10answers
8k 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 ...
24
votes
7answers
9k 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 ...
8
votes
1answer
354 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 JavaScript code ...
6
votes
5answers
3k views

Solving Fizz Buzz using Java

Problem: 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 ...
2
votes
3answers
365 views

Functional / Declarative FizzBuzz

I spent some time today trying to write FizzBuzz in a functional/declarative style. I thought it would be a good chance to get some feedback on it since I've been doing functional programming for ...
2
votes
1answer
65 views

FizzBuzz encapsulation In Ruby (identifying and separating concerns)

I'm working on an article about encapsulation in OOP, and I'm using the FizzBuzz problem to demonstrate what I think is so great about it. I'm hoping to share this with developers that might also be ...
11
votes
2answers
4k 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 ...
4
votes
1answer
323 views

Rust Iterator Fizzbuzz

Rust is one of my first forays on a strongly typed language, beginning to like it's strictness, and am looking to improve my comprehension. Rules Fizzbuzz is a programming challenge with the ...
11
votes
1answer
662 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 ...
7
votes
1answer
46k views

Finding the multiple of 3 and 5

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 ...
18
votes
6answers
6k views

Solving Fizz Buzz using LINQ in C#

The Fizz Buzz challenge is well-known and should not need any explanations, right? I recently got a bit bored and came up with a solution for Fizz Buzz using LINQ and even asynchronous code and a lot ...
4
votes
1answer
144 views

Extensible Fizzbuzz in Haskell

I am getting used to how things should be written/thought about in (idiomatic) Haskell. I wrote a FizzBuzz program that prints to the console. I wanted to generate things from the core info of the ...
8
votes
1answer
446 views

FizzBuzz in Csharp

For my first CodeReview, I would like to present my FizzBuzz solution in C#. My design has all of the rule logic about when to display what in separate classes through an interface. This design should ...
27
votes
4answers
2k views

1, 2, Fizz, 4, Buzz: FizzBuzz

I just recently started working on python (interesting language, actually), and, as I always do when I learn a new language (with the exception of BrainFuck, that's too hard), I write a FizzBuzz ...
3
votes
1answer
92 views

Beginner FizzBuzz

I wrote a FizzBuzz program to get comfortable with C++. I haven't learned any languages before this, but I'm doing this on my own. I learned if, ...
2
votes
1answer
76 views

FizzBuzz with more parameters in Swift

Here's my approach to an extensible version of the FizzBuzz challenge in Swift (so one can add more numbers to be checked against other than just 3 and ...
3
votes
3answers
281 views

A stream version of Fizz Buzz

I'm trying to learn streams and hashmaps, in doing so I want to make a very scalable, very clean version of FizzBuzz while adhering to the book Clean Code by Robert Cecil Martin. ...
5
votes
5answers
3k views

FizzBuzz in Python using a class

I recently read the book clean code by Robert C. Martin and I'm trying to apply his style of writing methods to the FizzBuzz programming example. So far I have two "public" methods called: ...
0
votes
1answer
667 views

Fizzbuzz but without if

Code first, elaboration later: ...
3
votes
3answers
150 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. ...
11
votes
1answer
212 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 ...
5
votes
1answer
955 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: ...
4
votes
1answer
390 views

FizzBuzz... with style (js, jquery, html, css) (and questions...)

I discovered the FizzBuzz test while looking up something else on stackoverflow, so I decided to try it and see what I would come up with. I'm kind of new to jquery and JavaScript, so I'm looking for ...
0
votes
1answer
410 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 ...
3
votes
3answers
303 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: ...
1
vote
1answer
230 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
91 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 (|>). ...
5
votes
1answer
438 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 ...
1
vote
2answers
175 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 ...

1
2 3 4 5