In the course of being asked to solve
After a while I'll post the original (non-JAPH) version, which is somewhat more flexible, legible, re-usable, and optionally verbose about its progress. Meanwhile, amuse yourselves with this...
$d='/usr/share/dict/words';# Adjust this to point to your dictionary w +ords file. @a=map _ ("",split//),qw'tjsu thanore arkceh';$^X=~/n\/(....)/;splice@ +a,2,@_,$+; sub _{my($f,@t)=@_;@c=('grep','-i','-e',"\"^$f".(join"",map".",@t).'$" +',$d);open _,"@c |";if(<_>){if(@t){my@l;for$i(0..$#t){my@e=@t;splice@e,$i,1;@r=_( +"$f$t[$i]" ,@e);for$r(@r){push@l,$r}}@l}else{$f}}else{return}};s(); $\ =pop@a;;pr +int"@a$/";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Word unscrambler for POSIX systems...
by hv (Prior) on May 15, 2003 at 23:16 UTC |