
Fifty Fizzbuzzes - Jakob
http://vihart.com/fifty-fizzbuzzes/
======
ummonk
This is where the actual fizz buzzes are:
[https://github.com/vihart/fiftyfizzbuzzes/blob/master/Fifty%...](https://github.com/vihart/fiftyfizzbuzzes/blob/master/Fifty%20Fizzbuzzes.ipynb)

~~~
bytematic
Note also that not all of them are correct :)

------
codereflection
I like this idea. I find it fascinating how many developers I've interviewed
who still have not come across FizzBuzz, and how many of those cannot solve
the problem. Some of the more interesting interviews I've given though have
been with people who know the FizzBuzz problem, where I ask them to make the
worst possible version of it that they can. It turns out to be more difficult
than they think it will be, and a deeper thinking and communicating exercise
than solving the simple FizzBuzz problem itself.

~~~
Waterluvian
Can't solve because they weren't actually programmers or more because of deer
in headlights?

~~~
codereflection
Yes.

------
Retr0spectrum
The python notebook linked in the main post:

[https://mybinder.org/v2/gh/quasiben/fiftyfizzbuzzes/master?f...](https://mybinder.org/v2/gh/quasiben/fiftyfizzbuzzes/master?filepath=Fifty%20Fizzbuzzes.ipynb)

------
romwell
Vi's site is down from the onslaught.

In the meantime, enjoy the ever-classic Fizz Buzz Enterprise Edition:

[https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...](https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition)

~~~
toxik
I opened the link thinking ”hah, what a gag!” But then I thought it’d be funny
to try to find the core fizzbuzz logic. Turns out that it hits way too close
to home, I just got really annoyed. Not sure what I expected.

~~~
Mikkeren
As the original author, I apologize for your agony.

This is a common complaint from people I discussed the project with, and the
obvious reason for the success of the project in terms of people contributing
patches and issues.

------
sincerely
I feel like everyone leaving a fizzbuzz solution in the comments of this post
is missing the point of this article...

~~~
jpindar
Fizzbuzz does that to some people. It's a mind-control meme, and a very
powerful one.

------
spatten
The Jupyter notebook is here:
[https://mybinder.org/v2/gh/quasiben/fiftyfizzbuzzes/master?f...](https://mybinder.org/v2/gh/quasiben/fiftyfizzbuzzes/master?filepath=Fifty%20Fizzbuzzes.ipynb)

The code on GitHub is here:
[https://github.com/vihart/fiftyfizzbuzzes/blob/master/Fifty%...](https://github.com/vihart/fiftyfizzbuzzes/blob/master/Fifty%20Fizzbuzzes.ipynb)

------
tzs
HN user aidenn0 won FizzBuzz a few years ago, with a Malbolge [1] version:

[https://news.ycombinator.com/item?id=4922282](https://news.ycombinator.com/item?id=4922282)

[1]
[https://en.wikipedia.org/wiki/Malbolge](https://en.wikipedia.org/wiki/Malbolge)

------
pronoiac
Wayback Machine mirror:
[https://web.archive.org/web/20181101043107/http://vihart.com...](https://web.archive.org/web/20181101043107/http://vihart.com/fifty-
fizzbuzzes/)

------
wodenokoto
Is this the same vihart of YouTube hexaflexagon fame?

[https://youtu.be/VIVIegSt81k](https://youtu.be/VIVIegSt81k)

~~~
ygra
Yes.

------
emmelaich
I didn't know that fizzbuzz was a children's game.

That explains a LOT. As in most descriptions of it are annoyingly ambiguous.

Whereas if you knew the game, you know it already.

~~~
thrmsforbfast
_> As in most descriptions of it are annoyingly ambiguous._

My very first interviewer (intentionally) didn't spec fizzbuzz correctly. The
real test was whether the candidate listened to the customer's/lead engineer's
spec instead of jumping to conclusions.

Fortunately, I was just entering college and hadn't heard of fizzbuzz before.
I passed the "test" but for the wrong reason.

~~~
segh
Being purposely misleading then penalising those who are misled doesn't seem
like a good hiring strategy, but then again, I've never tried to hire someone.

------
tracker1
Here's mine:

    
    
        Array.from(new Array(100)).forEach((_, i)=>++i&&console.log(((i%3?"":"Fizz")+(i%5?"":"Buzz"))||i))
    

[https://twitter.com/tracker1/status/1045475226128007169](https://twitter.com/tracker1/status/1045475226128007169)

~~~
stevekemp
I just committed a version that works in my golang BASIC interpreter:

[https://github.com/skx/gobasic/blob/master/examples/15-fizz-...](https://github.com/skx/gobasic/blob/master/examples/15-fizz-
buzz.bas)

Perhaps not the cleanest, since I support neither `CASE` nor `ELSE IF`. But it
seems to be correct.

------
grahamotte
We've killed it.

~~~
Retr0spectrum
[https://web.archive.org/web/20181101043107/vihart.com/fifty-...](https://web.archive.org/web/20181101043107/vihart.com/fifty-
fizzbuzzes/)

------
geraldbauer
FYI: You find 20+ in the FizzBuzz by Example - There's More Than One Way To Do
It (Free Online Book Edition) -
[http://yukimotopress.github.io/fizzbuzz](http://yukimotopress.github.io/fizzbuzz)

------
ErikAugust
One done over my lunch break today:
[https://gist.github.com/ErikAugust/67e61de02702b37ed04deea24...](https://gist.github.com/ErikAugust/67e61de02702b37ed04deea24452a534)

------
daphneokeefe
Here's my long-ago contribution. Scroll down for the visual.
[https://codepen.io/daphneokeefe/pen/Ayxlz](https://codepen.io/daphneokeefe/pen/Ayxlz)

------
equalunique
Vi Hart's YouTube channel is quite entertaining:
[https://www.youtube.com/user/Vihart](https://www.youtube.com/user/Vihart)

------
tne

      #include <stdlib.h>
      #include <stdio.h>
      
      static const char str[] = "fizzbuzz";
      
      static inline void out(int i, size_t offset, size_t sz)
      {
      	if (sz) {
      		fwrite(str + offset, sz, 1, stdout);
      	} else {
      		fprintf(stdout, "%d", i);
      	}
      	putchar('\n');
      }
      
      int main(void)
      {
      	for (int i = 1; i <= 100; i++) {
      		int a = i % 3 == 0;
      		int b = i % 5 == 0;
      		out(i, 4*((a^b)&b), 4*(a+b));
      	}
      	exit(0);
      }
    

There's a way to remove that conditional, too. Probably.

------
333c
This is called out in the post, but 32 is actually a really cool rhythmic (and
accurate) fizzbuzz.

------
bakul

      {:[~x!15;"fizzbuzz";~x!3;"fizz";~x!5;"buzz";$x]}'1+!100
      {:[0<#w::[x!3;"";"fizz"],:[x!5;"";"buzz"];w;$x]}'1+!100

~~~
bakul
Are there any shorter programs than these two k3 ones?

~~~
Nadya
In Dyalog APL:

    
    
        {∊(3↑(0=3 5|⍵)∪1)/'Fizz' 'Buzz'⍵}¨⍳100
    

[https://tryapl.org/?a=%7B%u220A%283%u2191%280%3D3%205%7C%u23...](https://tryapl.org/?a=%7B%u220A%283%u2191%280%3D3%205%7C%u2375%29%u222A1%29/%27Fizz%27%20%27Buzz%27%u2375%7D%A8%u2373100&run)

~~~
bakul
Neat!

------
xxs
A small exercise:

write Spectre/timing attacks resilient fizzbuzz.

------
sirsuki
Why does static content need a database connection? #OverEngineering

~~~
packetslave
Using WordPress is "over-engineering"?

~~~
dr_teh
Yes

~~~
egypturnash
More or less so than running a static site generator that lives on one
particular machine, and using Git to push your changes to the server?

~~~
influx
More like use a static generator to push to S3, optionally with a Cloudfront
distribution in front of it.

