Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add a wikipedia link about the enigma machine

  • Loading branch information...
commit 509823631641b9faae69eff370b20cfad0b1002c 1 parent d8cea1b
@nospampleasemam nospampleasemam authored
Showing with 10 additions and 2 deletions.
  1. +4 −1 lib/DDG/Goodie/Enigma.pm
  2. +6 −1 t/Enigma.t
View
5 lib/DDG/Goodie/Enigma.pm
@@ -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;
};
View
7 t/Enigma.t
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.