Advertisement
Guest User

Untitled

a guest
May 28th, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. def FizzBuzz(maxNum=100)
  2. string = ""
  3. for i in 1..maxNum
  4. string << "Fizz" if i % 3 == 0
  5. string << "Buzz" if i % 5 == 0
  6. puts "#{i}: #{string}"
  7. string = ""
  8. end
  9. end
  10.  
  11. FizzBuzz()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement