diff options
Diffstat (limited to 'lib/Enigmatic/Role')
-rw-r--r-- | lib/Enigmatic/Role/Rotate.pm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Enigmatic/Role/Rotate.pm b/lib/Enigmatic/Role/Rotate.pm new file mode 100644 index 0000000..89fb761 --- /dev/null +++ b/lib/Enigmatic/Role/Rotate.pm @@ -0,0 +1,9 @@ +package Enigmatic::Role::Rotate; +use DAKKAR::p 'role'; + +sub _rotate_by { + my ($letter,$position) = @_; + + return chr(ord('A')+ + (ord($letter)-ord('A')+26+$position)%26); +} |