Skip to content

Instantly share code, notes, and snippets.

@27Cobalter
Created June 4, 2017 02:38
Show Gist options
  • Save 27Cobalter/dd563a641d48f62f82ba5f13ba5a662e to your computer and use it in GitHub Desktop.
Save 27Cobalter/dd563a641d48f62f82ba5f13ba5a662e to your computer and use it in GitHub Desktop.
Fifteen = ->(x){x%15 == 0}
Five = ->(x){x%5 == 0}
Three = ->(x){x%3 == 0}
1.step(100) do |count|
puts case count
when Fifteen then
"FizzBuzz"
when Five then
"Buzz"
when Three then
"Fizz"
else
count
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment