Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
add a wikipedia link about the enigma machine
Browse files Browse the repository at this point in the history
  • Loading branch information
majuscule committed Jan 26, 2013
1 parent d8cea1b commit 5098236
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/DDG/Goodie/Enigma.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ handle remainder => sub {
$result = $enigma->encipher($_);
}

return "Enigma cipher (3 rotors, start positions [0,0,0], steps to rotate [0,1,2]): $result" unless $result eq '';
return "Enigma cipher (3 rotors, start positions [0,0,0], steps to rotate [0,1,2]): $result",
html => "<a href='https://en.wikipedia.org/wiki/Enigma_machine'>Enigma cipher</a> "
. "(3 rotors, start positions [0,0,0], steps to rotate [0,1,2]): $result"
unless $result eq '';
return;
};

Expand Down
7 changes: 6 additions & 1 deletion t/Enigma.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ ddg_goodie_test(
[qw(
DDG::Goodie::Enigma
)],
'enigma encode abcdefghijklmnopqrstuvwxyz' => test_zci('Enigma cipher (3 rotors, start positions [0,0,0], steps to rotate [0,1,2]): ZYHVPZNJBIHCUKXWXEUOSBLJRA'),
'enigma encode abcdefghijklmnopqrstuvwxyz' => test_zci(
'Enigma cipher (3 rotors, start positions [0,0,0], steps to rotate [0,1,2]): '
. 'ZYHVPZNJBIHCUKXWXEUOSBLJRA',
html => "<a href='https://en.wikipedia.org/wiki/Enigma_machine'>Enigma cipher</a> "
. "(3 rotors, start positions [0,0,0], steps to rotate [0,1,2]): "
. "ZYHVPZNJBIHCUKXWXEUOSBLJRA"),
);

done_testing;

0 comments on commit 5098236

Please sign in to comment.