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.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
by Darren Kirby
One thing that interests me are word puzzles and language oddities. One such
example is the self-documenting panagram. If a panagram is a sentence that uses
every letter in the alphabet, then a self-documenting panagram is a sentence
that enumerates its own letter count. Simple enough, but what if we state that
the letter count must be spelled ie: 'twenty-seven' instead of '27'. Now we
have a challenge.
A while back I wrote a script in Python that finds these sentences. Today I
rewrote it in Ruby and it found me this sentence:
Darren's ruby panagram program found this sentence which contains exactly
nine 'a's, two 'b's, five 'c's, four 'd's, thirty-five 'e's, nine 'f's,
three 'g's, nine 'h's, sixteen 'i's, one 'j', one 'k', two 'l's, three 'm's,
twenty-seven 'n's, fourteen 'o's, three 'p's, one 'q', fifteen 'r's,
thirty-four 's's, twenty-two 't's, six 'u's, six 'v's, seven 'w's, six 'x's,
seven 'y's, and one 'z'.
My script does have its problems, and I would love to see what kind of code the
Ruby experts could come up with to find self-documenting panagrams.
There is a lot more info on self-documenting panagrams at this address:
http://www.cs.indiana.edu/~tanaka/GEB/pangram.txt
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.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
by Darren Kirby
One thing that interests me are word puzzles and language oddities. One such
example is the self-documenting panagram. If a panagram is a sentence that uses
every letter in the alphabet, then a self-documenting panagram is a sentence
that enumerates its own letter count. Simple enough, but what if we state that
the letter count must be spelled ie: 'twenty-seven' instead of '27'. Now we
have a challenge.
A while back I wrote a script in Python that finds these sentences. Today I
rewrote it in Ruby and it found me this sentence:
Darren's ruby panagram program found this sentence which contains exactly
nine 'a's, two 'b's, five 'c's, four 'd's, thirty-five 'e's, nine 'f's,
three 'g's, nine 'h's, sixteen 'i's, one 'j', one 'k', two 'l's, three 'm's,
twenty-seven 'n's, fourteen 'o's, three 'p's, one 'q', fifteen 'r's,
thirty-four 's's, twenty-two 't's, six 'u's, six 'v's, seven 'w's, six 'x's,
seven 'y's, and one 'z'.
My script does have its problems, and I would love to see what kind of code the
Ruby experts could come up with to find self-documenting panagrams.
There is a lot more info on self-documenting panagrams at this address:
http://www.cs.indiana.edu/~tanaka/GEB/pangram.txt