Skip to content

Instantly share code, notes, and snippets.

@KOBA789
Created October 9, 2011 11:55
Show Gist options
  • Select an option

  • Save KOBA789/1273584 to your computer and use it in GitHub Desktop.

Select an option

Save KOBA789/1273584 to your computer and use it in GitHub Desktop.
CoffeeScript で FizzBuzz
fizzbuzz = (num) ->
if num % 15 == 0 then 'FizzBuzz'
else if num % 3 == 0 then 'Fizz'
else if num % 5 == 0 then 'Buzz'
else num
console.log (fizzbuzz num for num in [1..100]).join('\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment