Advertisement
Guest User

Vinegere

a guest
Nov 11th, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.37 KB | None | 0 0
  1. #!usr/bin/env perl
  2. use common::sense;
  3. use autobox::Core;
  4.  
  5. my @word = map { ord $_ } split '', uc $ARGV[0];
  6. my @key = map { ord $_ } split '', uc $ARGV[1];
  7. for (my $a = 0; $a <= $#key; $a++){
  8.     ((($word[$a] + $key[$a])%26)+65)->chr->print if ($ARGV[2] eq 'e');
  9.     ((($word[$a] - $key[$a])%26)+65)->chr->print if ($ARGV[2] eq 'd');}
  10.  
  11. #Aureliano Guedes
  12. #Forum Invaders
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement