Last active
December 11, 2015 14:18
Revisions
-
vstarck revised this gist
Jan 24, 2013 . 1 changed file with 28 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,16 +1,16 @@ function fizzBuzz(from, to) { function print() { var text = 'Fizz,,'.split(',')[from%3] + 'Buzz,,,,'.split(',')[from%5] var _ = {} _[text] = '' _[''] = from console.log( from, ' -> ', text + _[text] ) } @@ -26,10 +26,32 @@ function fizzBuzz(from, to) { function loop() { print() next() } loop() } fizzBuzz(1, 20) /* 1 -> 1 2 -> 2 3 -> Fizz 4 -> 4 5 -> Buzz 6 -> Fizz 7 -> 7 8 -> 8 9 -> Fizz 10 -> Buzz 11 -> 11 12 -> Fizz 13 -> 13 14 -> 14 15 -> FizzBuzz 16 -> 16 17 -> 17 18 -> Fizz 19 -> 19 20 -> Buzz */ -
vstarck revised this gist
Jan 24, 2013 . 1 changed file with 15 additions and 11 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,31 +1,35 @@ function fizzBuzz(from, to) { function print() { var text = ',,Fizz'.split(',')[from%3] + ',,,,Buzz'.split(',')[from%5] var _ = {} _[text] = '' _[''] = from console.log( text + _[text] ) } function next() { var _ = {} _[from] = loop _[to] = function() {} _[from++]() } function loop() { print() next() } loop() } fizzBuzz(1, 20) -
vstarck revised this gist
Jan 24, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ function fizzBuzz(from, to) { } function loop() { var _ = {} _[from] = loop _[to] = function() {} -
vstarck created this gist
Jan 23, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ function fizzBuzz(from, to) { function print() { var text = ',,Fizz'.split(',')[from%3] + ',,,,Buzz'.split(',')[from%5] var _ = {} _[text] = '' _[''] = from console.log( text + _[text] ) } function loop() { var _ = [] _[from] = loop _[to] = function() {} print() _[from++]() } loop() } fizzBuzz(1, 20)