Practice
Compete
Contribute
Learn
Log In
Sign Up
Ruby sample code
tbpgr
7,559 views
01
FizzBuzz
02
Fibonacci
03
Prime
04
Eto
1/4
FizzBuzz
Next:
Fibonacci
FizzBuzz
FizzBuzz
1
2
3
4
5
6
7
8
(
1
..
100
)
.
each
do
|
n
|
puts
case
0
when
n
%
15
then
:FizzBuzz
when
n
%
3
then
:Fizz
when
n
%
5
then
:Buzz
else
n
end
end
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Run
6
4
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
Suggested playgrounds
Tic Tac Toe Game Implementation
By
agorneo
3,252
12
0
Ruby Introduction (Dutch)
By
PeterDR
10.6K
2
0
Chuck Norris
By
nbbroo
2,847
2
0
MessageMedia Messages Ruby
By
IbrahimT
2,484
2
2
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants
Keyboard Shortcuts:
?
Show / hide this help menu
×