Guest User

Untitled

a guest
Jul 17th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.21 KB | None | 0 0
  1. (1..25).collect { |x|
  2.   mod3 = x.modulo(3) == 0
  3.   mod5 = x.modulo(5) == 0
  4.  
  5.   puts case
  6.     when mod3 && mod5 then "fizzbuzz :D"
  7.     when mod3 then "fizz."
  8.     when mod5 then "buzz."
  9.     else "(#{x})"
  10.     end
  11. }
Add Comment
Please, Sign In to add comment