R
Ruby Quiz
The three rules of Ruby Quiz:
1. Please do not post any solutions or spoiler discussion for this quiz until
48 hours have passed from the time on this message.
2. Support Ruby Quiz by submitting ideas as often as you can:
http://www.rubyquiz.com/
3. Enjoy!
Suggestion: A [QUIZ] in the subject of emails about the problem helps everyone
on Ruby Talk follow the discussion. Please reply to the original quiz message,
if you can.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Here's a fun little challenge from the Educational Computing Organization of
Ontario.
Given a single word as input try to find a repeated letter inside of it such
that you can loop the text around and reuse that letter. For example:
$ ruby word_loop.rb Mississippi
i
p
p
Mis
ss
si
or:
$ ruby word_loop.rb Markham
Ma
ar
hk
or:
$ ruby word_loop.rb yummy
yu
mm
If a loop cannot be made, your code can just print an error message:
$ ruby word_loop.rb Dana
No loop.
1. Please do not post any solutions or spoiler discussion for this quiz until
48 hours have passed from the time on this message.
2. Support Ruby Quiz by submitting ideas as often as you can:
http://www.rubyquiz.com/
3. Enjoy!
Suggestion: A [QUIZ] in the subject of emails about the problem helps everyone
on Ruby Talk follow the discussion. Please reply to the original quiz message,
if you can.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Here's a fun little challenge from the Educational Computing Organization of
Ontario.
Given a single word as input try to find a repeated letter inside of it such
that you can loop the text around and reuse that letter. For example:
$ ruby word_loop.rb Mississippi
i
p
p
Mis
ss
si
or:
$ ruby word_loop.rb Markham
Ma
ar
hk
or:
$ ruby word_loop.rb yummy
yu
mm
If a loop cannot be made, your code can just print an error message:
$ ruby word_loop.rb Dana
No loop.