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