The three rules of Ruby Q.:
-
Please do not post any solutions or spoiler discussion for this quiz
until
48 hours have passed from the time on this message. -
Support Ruby Q. by submitting ideas as often as you can:
- Enjoy!
Suggestion: A [QUIZ] in the subject of emails about the problem helps
everyone
on Ruby T. 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