Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def FizzBuzz(maxNum=100)
- string = ""
- for i in 1..maxNum
- string << "Fizz" if i % 3 == 0
- string << "Buzz" if i % 5 == 0
- puts "#{i}: #{string}"
- string = ""
- end
- end
- FizzBuzz()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement