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/
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/
I did not know about this, thanks for sharing. I will remember this!
This was great! Love it when there is a simple probable mathematic solution to these kinds of things!
Me too, so clean! I love maths but I'm crap at it myself xD