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
0 votes
1 answer
66 views

Standard fizz (3) buzz (5)

Is there a possibility to refactor this method and make it clean and respect solid principles. ...
13 votes
3 answers
2k views

Sum of FizzBuzz numbers with modern C++

I am learning to write more modern C++, since my C++ is from the 1990s (I'm a C# programmer). I need to get used to the STL algorithms and such. So I tried some kata, summing up numbers in a given ...
4 votes
2 answers
113 views

yet another fizz buzz

FizzBuzz is a well known Exercise among programmers, but I wanted to add an aspect called "openClosed" principle (from SOLID) FizzBuzz is a very simple programming task, used in software ...
  • 2,581
2 votes
2 answers
201 views

FizzBuzz in JavaScript (node.js), my first JavaScript program

I had just decided to learn JavaScript, so I wrote this program. I am sure you know what FizzBuzz is so I wouldn't describe it here. Console output: ...
0 votes
1 answer
108 views

Fizzbuzz Solution - complexity, readability, performance, lines, obfuscation... - .sort()

The fizzbuzz challenge presents a lot of interesting questions for 'intermediate' programmers like myself. I have found that I don't actually know where to draw the line with, complex (hard to read ...
  • 111
3 votes
2 answers
118 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 ...
2 votes
1 answer
135 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. ...
  • 23
5 votes
3 answers
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 ...
  • 729
4 votes
1 answer
176 views

FizzBuzz in Vyxal

I've created this code in the golfing language Vyxal to do FizzBuzz: ...
1 vote
0 answers
79 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. ...
7 votes
3 answers
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. ...
's user avatar
2 votes
1 answer
169 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
1 answer
253 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 ...
  • 1
2 votes
2 answers
191 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 ...
12 votes
4 answers
3k 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 ...
2 votes
5 answers
173 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 ...
0 votes
1 answer
144 views

FizzBuzz Optimisation | Modulus vs Decrement Operator Performance

This is not the typical debate in FizzBuzz code about how to handle repeated if statements. I believe that it is a matter of personal preference. I am here to ask ...
5 votes
2 answers
148 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 ...
  • 53
4 votes
3 answers
504 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. ...
6 votes
5 answers
5k 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 ...
's user avatar
2 votes
1 answer
70 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 ...
3 votes
5 answers
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: ...
  • 802
4 votes
1 answer
386 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 ...
  • 976
18 votes
6 answers
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
1 answer
174 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 ...
  • 145
8 votes
1 answer
607 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 ...
3 votes
1 answer
103 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
1 answer
84 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
3 answers
325 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. ...
2 votes
3 answers
421 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 ...
  • 333
0 votes
1 answer
770 views

Fizzbuzz but without if

Code first, elaboration later: ...
5 votes
1 answer
1k 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
3 answers
164 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. ...
24 votes
7 answers
10k 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
1 answer
506 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 ...
  • 285
1 vote
1 answer
265 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 ...
  • 1,555
3 votes
1 answer
92 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
1 answer
544 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
1 answer
307 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
1 answer
224 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 ...
  • 12.8k
2 votes
3 answers
2k 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
3 answers
863 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
1 answer
453 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 ...
  • 11.1k
13 votes
4 answers
3k 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, ...
  • 11.1k
6 votes
1 answer
273 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 ...
  • 1,333
3 votes
3 answers
365 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: ...
  • 205
4 votes
1 answer
166 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: ...
  • 143
11 votes
1 answer
727 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 ...
's user avatar
3 votes
5 answers
291 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
2 answers
295 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 ...
  • 53

1
2 3 4 5