Skip to content

Instantly share code, notes, and snippets.

@calorie
Created February 18, 2013 14:42
Show Gist options
  • Save calorie/4977903 to your computer and use it in GitHub Desktop.
Save calorie/4977903 to your computer and use it in GitHub Desktop.
fizzbuzz
def fizzbuzz(i)
puts i % 15 == 0 ? 'FizzBuzz' :
i % 3 == 0 ? 'Fizz' :
i % 5 == 0 ? 'Buzz' :
i
fizzbuzz(i+1) unless i == ARGV[1].to_i
end
fizzbuzz ARGV[0].to_i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment