Skip to content

Instantly share code, notes, and snippets.

@hiroshi-maybe
Created February 26, 2012 01:41
Show Gist options
  • Save hiroshi-maybe/1912154 to your computer and use it in GitHub Desktop.
Save hiroshi-maybe/1912154 to your computer and use it in GitHub Desktop.
fizzbuzz
(1..1000000) .each {|i|
result=(i%FIZZ_NUM==0 ? "Fizz":"")+(i%BUZZ_NUM==0 ? "Buzz":"")
p result.empty? ? i.to_s : result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment