------art_124193_24364152.1186328773721
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

2007/8/3, Ruby Quiz <james / grayproductions.net>:
>
> Your mission is to pick a word list in some language (it will have be one
> that
> uses roman letters) and write Ruby code to filter the list to extract all
> the
> words which are valid numbers in a given base.



Hi,


I have come up with this one-liner:

----------8<----------
puts File.readlines
('/usr/share/dict/words').grep(/\A[a-#{((b ۰ݮ驭ݫگ
---------->8----------

Example:
$ ruby ./rq133_numberscanbewords_rafc.rb 16
a
abed
accede
acceded
ace
aced
ad
add
added
b
baa
baaed
babe
bad
bade
be
bead
beaded
bed
bedded
bee
beef
beefed
c
cab
cabbed
cad
cede
ceded
d
dab
dabbed
dad
dead
deaf
deb
decade
decaf
deed
deeded
deface
defaced
e
ebb
ebbed
efface
effaced
f
fa
facade
face
faced
fad
fade
faded
fed
fee
feed


Regards,
R.

------art_124193_24364152.1186328773721--