Created
April 11, 2013 03:30
-
-
Save klamping/5360521 to your computer and use it in GitHub Desktop.
Two fizzbuzz implementations, one fails.
This file contains 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
// Copy and paste this code directly into you JS file | |
// access the first function via fizzBuzzA(num) | |
// example: | |
// var result = fizzBuzzA(15); | |
eval(function(p,a,c,k,e,d){while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+c+'\\b','g'),k[c])}}return p}('9 8(0){2(7 0!==\'4\'){1 10}2(0%3&&0%6){1 0}2(0%5){1\'11\'}2(0%3){1\'12\'}1\'13\'}',10,14,'num|return|if||number|||typeof|fizzBuzzA|function|false|fizz|buzz|fizzbuzz'.split('|'))) | |
// access the second function via fizzBuzzB(num) | |
// example: | |
// var result = fizzBuzzB(10); | |
eval(function(p,a,c,k,e,d){while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+c+'\\b','g'),k[c])}}return p}('8 7(0){2(6 0!==\'4\'){1 9}2(0%3&&0%5){1 0}2(0%5){1\'10\'}2(0%3){1\'11\'}1\'12\'}',10,13,'num|return|if||number||typeof|fizzBuzzB|function|false|fizz|buzz|fizzbuzz'.split('|'))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment