2022 Developer Survey is open! Take survey.

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
2 votes
2 answers
119 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: ...
user avatar
0 votes
1 answer
79 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 ...
user avatar
  • 111
3 votes
2 answers
104 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 ...
user avatar
2 votes
1 answer
112 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. ...
user avatar
  • 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 ...
user avatar
  • 729
4 votes
1 answer
174 views

FizzBuzz in Vyxal

I've created this code in the golfing language Vyxal to do FizzBuzz: ...
user avatar
1 vote
0 answers
64 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. ...
user avatar
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. ...
user avatar
2 votes
1 answer
138 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 ...
user avatar
0 votes
1 answer
202 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 ...
user avatar
  • 1
2 votes
2 answers
187 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 ...
user avatar
12 votes
4 answers
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 ...
user avatar
2 votes
5 answers
166 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 ...
user avatar
0 votes
1 answer
130 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 ...
user avatar
5 votes
2 answers
139 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 ...
user avatar
  • 53
3 votes
3 answers
452 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. ...
user avatar
6 votes
5 answers
4k 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 ...
user avatar
2 votes
1 answer
67 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 ...
user avatar
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: ...
user avatar
  • 802
4 votes
1 answer
356 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 ...
user avatar
  • 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 ...
user avatar
4 votes
1 answer
160 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 ...
user avatar
  • 145
8 votes
1 answer
553 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 ...
user avatar
3 votes
1 answer
98 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, ...
user avatar
2 votes
1 answer
83 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 ...
user avatar
3 votes
3 answers
304 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. ...
user avatar
2 votes
3 answers
401 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 ...
user avatar
  • 333
0 votes
1 answer
716 views

Fizzbuzz but without if

Code first, elaboration later: ...
user avatar
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: ...
user avatar
3 votes
3 answers
162 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. ...
user avatar
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 ...
user avatar
0 votes
1 answer
456 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 ...
user avatar
  • 285
1 vote
1 answer
258 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 ...
user avatar
  • 1,545
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 (|>). ...
user avatar
5 votes
1 answer
489 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 ...
user avatar
4 votes
1 answer
270 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 ...
user avatar
11 votes
1 answer
221 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 ...
user avatar
  • 12.6k
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? ...
user avatar
4 votes
3 answers
853 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: ...
user avatar
1 vote
1 answer
442 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 ...
user avatar
  • 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, ...
user avatar
  • 11.1k
6 votes
1 answer
259 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 ...
user avatar
  • 1,323
3 votes
3 answers
344 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: ...
user avatar
  • 205
4 votes
1 answer
162 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: ...
user avatar
  • 143
11 votes
1 answer
705 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 ...
user avatar
3 votes
5 answers
278 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 ...
user avatar
5 votes
2 answers
285 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 ...
user avatar
  • 53
3 votes
1 answer
155 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 ...
user avatar
  • 11.4k
3 votes
3 answers
148 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. ...
user avatar
  • 133
2 votes
2 answers
104 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 ...
user avatar
  • 21

1
2 3 4 5