On Mon, 14 Aug 2000, Daniel Chetlin wrote: > On the same subject, I was asked recently to think of a word which had 4 > consecutive letters (like abcd or ghij). Failing miserably to think of one, I > decided it would be good for golf. The solution I came up with is pretty long, > and I bet a better one exists, so I'm throwing out the challenge. > > perl -wne 'sub f{chr(ord($1)+pop)};print if/(.)(??{f(1)})(??{f(2)})(??{f(3)})/' > /usr/dict/2words perl -ne '$"=""; print if /#@{[map+("|",a..z)[0,$_..$_+3], 1..23]}/oi;' /usr/dict/word.lst Removing the /o saves a stroke, but makes it unbearably slow. The /i may also be omitted if you use an all-lowercase word list. Of course the word list is assumed not to contain any # characters.. > BTW, no words that fit that pattern are in the standard Linux /usr/dict/words > -- I had to use a different word list that I found elsewhere. But reasonably > common words that fit do exist. Ignoring inflected forms, I find the following in YAWL: limnophilous overstudy overstuff overstunk superstud understudy The fact that 5 out of the 6 contain the same sequence, "rstu", with only "limnophilous" (anyone with a big dic care to quote a definition?) having "mnop" seems quite curious. -- Ilmari Karonen - http://www.sci.fi/~iltzu/ "The screwdriver *is* the portable method." -- Abigail in c.l.p.m ==== Want to unsubscribe from Fun With Perl? Well, if you insist... ==== Send email to <fwp-request@technofile.org> with message _body_ ==== unsubscribe