DEV Community

Discussion on: [Challenge] šŸ FizzBuzz without if/else

Collapse
 
rushsteve1 profile image
Steven vanZyl

The cleanest and best FizzBuzz implementation I know of doesn't use any if statements at all. Actually it doesn't use any control flow at all in most languages.
The approach is fully described here: philcrissman.net/posts/eulers-fizz...

On my Repl.it I also have this same approach implemented in several other languages:
repl.it/@rushsteve1/

Collapse
 
nombrekeff profile image
Keff

I did not know about this, thanks for sharing. I will remember this!

Collapse
 
coreyja profile image
Corey Alexander

This was great! Love it when there is a simple probable mathematic solution to these kinds of things!

Collapse
 
nombrekeff profile image
Keff

Me too, so clean! I love maths but I'm crap at it myself xD