Created
September 14, 2014 15:55
-
-
Save migimunz/0293b2be10c032b4d63a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function f(x) { | |
return Math.round(1 / (0.5 * Math.sqrt(Math.PI)) * Math.pow(Math.E, (-Math.pow(x%3, 2)/Math.pow(0.1,2))) | |
+ 1 / (0.27 * Math.sqrt(Math.PI)) * Math.pow(Math.E, (-Math.pow(x%5, 2)/Math.pow(0.1,2)))); | |
} | |
var text = ["%", "Fizz", "Buzz", "FizzBuzz"]; | |
for(var x = 1; x <= 100; ++x) { | |
console.log(text[f(x)].replace('%', x)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment