The three rules of Ruby Q.:
Please do not post any solutions or spoiler discussion for this quiz
48 hours have passed from the time on this message.
Support Ruby Q. by submitting ideas as often as you can:
Suggestion: A [QUIZ] in the subject of emails about the problem helps
on Ruby T. follow the discussion. Please reply to the original quiz
if you can.
by Morton G.
When working with hexadecimal numbers it is likely that you’ve noticed
numbers are also words. For example, ‘bad’ and ‘face’ are both English
valid hex numbers (2989 and 64206, respectively, in decimal). I got to
that it would be interesting to find out how many and which hex numbers
also valid English words. Of course, almost immediately I started to
generalizations. What about other bases? What about languages other than
Your mission is to pick a word list in some language (it will have be
uses roman letters) and write Ruby code to filter the list to extract
words which are valid numbers in a given base. For many bases this isn’t
interesting task–for bases 2-10, the filter comes up empty; for bases
the filter output is uninteresting (IMO); for bases approaching 36, the
passes almost everything (also uninteresting IMO). However, for bases in
range from 14 to about 22, the results can be interesting and even
especially if one constrains the filter to accept only words of some
/usr/share/dict/words for my word list. Participants who don’t
that list on their system or want a different one can go to Kevin’s Word
Page (http://wordlist.sourceforge.net/) as a source of other word lists.
Some points you might want to consider: Do you want to omit short words
and ‘ad’? (I made word length a parameter). Do you want to allow
words (I prohibited them)? Do you want to restrict the bases allowed (I