in reply to Re: (Golf) Cryptographer's Tool #1
in thread (Golf) Cryptographer's Tool #1

Following the spec at 61:
sub c { ($_,$a,%h)=@_;join'',map{substr$a,($h{$_}||=keys%h)-1,1}/./gs }
... and also in spiritus strictus at 62:
sub c { my%h;join'',map{substr$_[1],($h{$_}||=keys%h)-1,1}$_[0]=~/./gs }
               s aamecha.s a..a\u$&owag.print

Replies are listed 'Best First'.
Re: Re: Re: (Golf) Cryptographer's Tool #1
by chipmunk (Parson) on Jun 20, 2001 at 06:05 UTC
    Oo, nice! And with inspiration once again from btrott's substitution approach:
    sub canonical { ($_,$a,%h)=@_;s/./substr"a$a",$h{$&}||=keys%h,1/gse;$_ }
    Back down to 54!