in reply to beatnik poetry generator
Ain't command-line switches grand? Or of course (if you ignore the convenience of reversing a string):
perl -F// -lane '$words{join"",reverse @F}=$_; END{foreach(sort keys %words){print $words{$_}}}' /usr/share/dict/words
Though you might consider that overdoing it (or, alternatively, half-assed obfuscation). I just really like autosplit. :-)
To make it a mesmerizing background instead of a printed list, stick a sleep 0.1 statement in the foreach loop. Then remember to look away after a while to refocus your eyes. <grin>
But however you run it, it's cool.
Edit:
Ooh! Ooh! Now I feel just despicably clever. Recalling the Schwartzian Transform and other list-oriented fun, I now present what I'd guess is the shortest possible generator:
perl -e 'print sort {reverse ($a) cmp reverse ($b)} <>' /usr/share/dict/words
Man, I love list context...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: beatnik poetry generator
by Boldra (Curate) on Apr 09, 2001 at 14:04 UTC | |
by ChemBoy (Priest) on Apr 09, 2001 at 20:22 UTC |