in reply to (Golf) Cryptographer's Tool #2.5
  psub x{ ($l,$t,$c,$n)=@_; # 17 while($_=chop$n){ # 17 $b=\substr$t,index($l,chop$c),1; # 32 /$$b/||$$b=~/ /&&$t!~/$_/||return; # 34 $$b=$_ # 6 } # 1 $t # 2 } # 109 chars $alpha="abcdeflprxyz"; $trans=" "; $cipher="abcadbbe"; $word="deadbeef"; $trans = x($alpha,$trans,$cipher,$word); $_=$cipher; $trans and eval"tr/$alpha/$trans/"; print; $cipher="zbxf"; $word="perl"; $trans = x($alpha,$trans,$cipher,$word); $_=$cipher; $trans and eval"tr/$alpha/$trans/"; print;
|
|---|