Skip to content

Instantly share code, notes, and snippets.

@dirceu
Created March 24, 2010 23:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dirceu/342940 to your computer and use it in GitHub Desktop.
Save dirceu/342940 to your computer and use it in GitHub Desktop.
var sys = require('sys');
function fizzbuzz(n) {
if(n == 101)
return;
if(n % 15 == 0)
sys.puts('FizzBuzz');
else if(n % 5 == 0)
sys.puts('Buzz');
else if(n % 3 == 0)
sys.puts('Fizz');
else
sys.puts(n)
fizzbuzz(n+1);
}
fizzbuzz(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment