Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Fizz Buzz example in Ruby
SUBMITTED BY:
Guest
DATE:
May 21, 2015, 10:21 a.m.
FORMAT:
Ruby
SIZE:
197 Bytes
Raw
Download
Tweet
HITS:
1050
Go to comments
Report
# fizz buzz ruby example
p
begin
1
.
upto
(
?d
){
|
n
|
puts
[
"Fizz
#{
s
=[
:Buzz
][
n
%
5
]
}
"
][
n
%
3
]||
s
||
n
}
rescue
Exception
puts
"
#{
$!
}
(
#{
$!
.
class
}
)"
$stdout
.
flush
raise
$!
end
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus