Employers: discover CodinGame for tech hiring
CodinGame - Home
ACTIVITIES
PRACTICE
COMPETE
COOPERATE
LEARN
EVENTS
COMMUNITY
CONTRIBUTIONS
LIVE STREAMS
DISCORD
FORUMS
BLOG
Get a job
1
Log In
Sign Up
Ruby sample code
tbpgr
12.9K views
01
FizzBuzz
02
Fibonacci
03
Prime
04
Eto
1/4
FizzBuzz
Next:
Fibonacci
FizzBuzz
FizzBuzz
1
2
3
4
5
6
7
8
9
(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
Run
9
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
9,023
26
0
Ruby Introduction (Dutch)
By
PeterDR
23.3K
4
0
Chuck Norris
By
nbbroo
3,786
6
0
MessageMedia Messages Ruby
By
IbrahimT
2,640
2
0
CodinGame - Home
ABOUT US
CAREERS
PRIVACY
FAQ
CodinGame - Work
The #1 tech hiring platform
SCREENING
SOURCING
RETAIN
ABOUT US
CAREERS
PRIVACY
FAQ
Facebook
YouTube
Twitter
LinkedIn
FR
EN
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
×