TPC6 T-shirt idea part II

Chris Radcliff cradcliff at bluetitan.com
Wed May 15 16:21:30 CDT 2002


For the sake of over-engineering, I've attached the Perl script which 
generates the translation string for any given 21-character output string.

I should stop working on these so late at night... :)

-- 
Chris Radcliff
Lead Software Engineer
Blue Titan Software: Mission-Critical Web Services
858.622.1164
-------------- next part --------------
$msg = $ARGV[0];

$japh = "JustAnotherPerlHacker";

if (length($japh) != length($msg))
{
  print "Usage: generate_matrix.pl STRING\n";
  print "  STRING must be ", length($japh), " characters long.\n";
  exit;
}

my @msg = split // , $msg;
my @japh = split // , $japh;

for (0 ..$#msg)
{
  print "$msg[$_]: ", ord($msg[$_]), "\t";
  print "$japh[$_]: ", ord($japh[$_]), "\t";
  $dif = ord($japh[$_]) - ord($msg[$_]);
  print " = ", "$dif\n";
  push(@out, $dif);
}

print "Translation matrix:\n";
my $japh = 'JAPH';
my $c = 0;
foreach my $character (@out)
{
  my $spacer = substr($japh, ($c % 4), 1);
  print lc($spacer);
  $character =~ s/-/$spacer/;
  print $character;
  
  $c++;
}

print "JAPH\n";


More information about the San-Diego-pm mailing list