Bifid cipher: Difference between revisions
Content added Content deleted
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: consolidate two lists into a single array) |
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: additional polishing) |
||
Line 187: | Line 187: | ||
for my($k,$v) (%P) { $I{$v} = $k } |
for my($k,$v) (%P) { $I{$v} = $k } |
||
for my ($n,$char) (indexed split '', ($text =~ s/\s//gr)) { |
for my ($n,$char) (indexed split '', ($text =~ s/\s//gr)) { |
||
for my($ |
for my($m,$i) (indexed split ' ', $P{$char}) { $c[$m][$n] = $i } |
||
} |
} |
||
for my($i,$j) ( |
for my($i,$j) ($c[1]->@*, $c[0]->@*) { $encrypted .= $I{"$j $i"} } |
||
$encrypted |
$encrypted |
||
} |
} |