MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/1tej9n2/fizz_buzz/
r/programminghorror • u/susam • May 16 '26
9 comments sorted by
21
Does make sense, such cyclic things as printing fizz or buzz can be modeled as frequency components of cyclic functions like sin and cos combined. It's like a Fourier transform, extracting the separate frequencies out of a combined function.
Still overkill of course, but makes sense.
15
What in the fuck?
I'm impressed and amazed 😃
5
This rremind me the CubeScript... in a bit less Lisp like.
As the author of several illegible high hundreds to low thousand character Python one liners, I approve! Nice!
2
...now I want to optimize it
8 u/Certain-Flow-0 May 16 '26 Start with removing fluff like 2pi, they just make things look more complex than they actually are 1 u/findus_l May 17 '26 Here is optimized fizzbuzz. It's a really good read. https://codegolf.stackexchange.com/questions/215216/high-throughput-fizz-buzz 1 u/findus_l May 17 '26 One of my favourite quotes from the Assembler solution:the relevant processor bottleneck – L2 cache write speedYeah so when L2 cache is the bottleneck you know it's good.
8
Start with removing fluff like 2pi, they just make things look more complex than they actually are
1
Here is optimized fizzbuzz. It's a really good read. https://codegolf.stackexchange.com/questions/215216/high-throughput-fizz-buzz
1 u/findus_l May 17 '26 One of my favourite quotes from the Assembler solution:the relevant processor bottleneck – L2 cache write speedYeah so when L2 cache is the bottleneck you know it's good.
One of my favourite quotes from the Assembler solution:
the relevant processor bottleneck – L2 cache write speed
Yeah so when L2 cache is the bottleneck you know it's good.
How the hell do people come up with stuff like this?
21
u/zattebij May 16 '26
Does make sense, such cyclic things as printing fizz or buzz can be modeled as frequency components of cyclic functions like sin and cos combined. It's like a Fourier transform, extracting the separate frequencies out of a combined function.
Still overkill of course, but makes sense.
15
u/IllustratorFar127 May 16 '26
What in the fuck?
I'm impressed and amazed 😃
5
u/asmanel May 16 '26
This rremind me the CubeScript... in a bit less Lisp like.
5
u/abigail3141 [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” May 16 '26
As the author of several illegible high hundreds to low thousand character Python one liners, I approve! Nice!
2
u/california_snowhare May 16 '26
...now I want to optimize it
2
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” May 16 '26
How the hell do people come up with stuff like this?