Questions tagged [fizzbuzz]

Challenges related to number sequences with replacement of some exact multiples.

Filter by
Sorted by
Tagged with
8 votes
5 answers
876 views

Is it shuffled FizzBuzz?

A twin of this. FizzBuzz is where a range of positive integers is taken, and numbers divisible by 3 are replaced with "Fizz", divisible by 5 with "Buzz" and divisible by 15 with &...
user avatar
  • 30.5k
25 votes
7 answers
3k views

Fix my FizzBuzz

FizzBuzz is where a range of positive integers is taken, and numbers divisible by 3 are replaced with "Fizz", divisible by 5 with "Buzz" and divisible by 15 with "FizzBuzz&...
user avatar
  • 30.5k
29 votes
12 answers
1k views

Nth FizzBuzz Number

Introduction Everyone knows the FizzBuzz sequence. It goes something like this: 1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz . . . In case you don't ...
user avatar
  • 3,079
22 votes
19 answers
4k views

Generalized FizzBuzz

Task FizzBuzz, but instead of 3 and 5, you'll take the numbers and corresponding strings as input. You can assume all inputted numbers are coprime (and \$\ge 2\$). You'll receive one or more numbers, ...
user avatar
27 votes
3 answers
2k views

Efficient Bytewise FizzBuzz

Given the following Python "reference implementation" of non-terminating FizzBuzz: ...
user avatar
  • 439
283 votes
33 answers
193k views

High throughput Fizz Buzz

Fizz Buzz is a common challenge given during interviews. The challenge goes something like this: Write a program that prints the numbers from 1 to n. If a number is divisible by 3, write Fizz instead....
user avatar
12 votes
12 answers
850 views

Fizzbuzz in any base

Challenge Input: An integer \$b\$ between 2 and 62 (inclusive). Output: Count from \$1\$ to the equivalent of \$5000_{10}\$ in base \$b\$, using any reasonable representation for the digits. ...
user avatar
16 votes
5 answers
917 views

Abstract Syntax Tree Golfing: FizzBuzz, Python

Summary Implement FizzBuzz in Python, with the fewest possible tokens. Challenge Write a program that prints the decimal numbers from 1 to 100 inclusive. But for multiples of three print “Fizz” ...
user avatar
  • 41.3k
183 votes
382 answers
65k views

1, 2, Fizz, 4, Buzz

Introduction In our recent effort to collect catalogues of shortest solutions for standard programming exercises, here is PPCG's first ever vanilla FizzBuzz challenge. If you wish to see other ...
user avatar
  • 22.8k
34 votes
4 answers
1k views

FizzBuzz Reverse Solver

Synopsis: Given the output of a generalised FizzBuzz program, return the list of factors and words used for the program. Challenge Description Imagine a generalised FizzBuzz program that takes in as ...
user avatar
  • 8,599
17 votes
13 answers
2k views

Create a FizzBuzz compiler

Welcome to the world of compiler golf. Your task is to write a program that generates another program to play a variant of FizzBuzz on spec. Your compiler Write a compiler that generates variants of ...
user avatar
  • 2,045