Hope you like it.@p=sort a @a=split//,"Just Another Perl Hacker!";while(f(@p)){{@t=@p;@ +m= sort a@p[@w];$t[$_]=pop@m for@w;redo if f(@t)>=f(@p)}print@p=@t,$",f(@ +p) ,$/}sub p{$c=0;push@{$l{$_}},$c++for@a}sub f{@w=$f=$d=$c=p;map{$f+=(($ +z= (shift@{$l{$_}})-$c++)**2)**.5;$w[$d++]=$c-1if$z}@_;$f}sub a{rand cmp. +5}
In reply to GA(ish) JAPH by teamster_jr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |