#!/usr/bin/perl
# foxtrot.pl
# model for solution
# (c) Ken Owen 2010

# The key solutions:
#A=square root of 121=11
#B=2 cubed=8
#C=sine of pi/2=1
#D=51/3=17
#E=cube root of 1000=10
#F=.5(.5(.5(16)))=2
#G=(5/3)+(5/3)+(5/3)=5
#H=4205-4186=19
#I=square root of 13 * square root of 13=13
#J=(14/5)*(10/4)=7
#K=absolute value of -26=26
#L=(9x+9x)/3x=6
#M=(9*11)-(7*11)=22
#N=square root of 400=20
#O=1+2+3+4+5=15
#P=4 to the power of the square root of 4=16
#Q=integral of 9x^2dx from 0 to 2=24
#R=(5pi + 4pi)/pi=9
#S=(5*2*2)+3=23
#T=square root of 144=12
#U=-3 times the cosine of pi=3
#V=5 to the fourth divided by 5 squared=25
#W=2 to the power of (5-3)=4
#X=9216/512=18
#Y=square root of 49 times the square root of 9=21
#Z=(14*14*14)/(14*14)=14

if(@ARGV==0){
    print "\nusage: ./foxtrot.pl <word to decode> [<2nd word to decode>] etc.\n\n";
    exit;
}
my @s=('','C','F','U','W','G','L','J','B','R','E','A','T','I','Z','O','P','D','X','H','N','Y','M','S','Q','V','K');
my @wordcode, $words;
foreach $ARGV(@ARGV){
    @wordcode=split/-/,$ARGV;
    foreach $wordcode(@wordcode){
        $words .= $s[$wordcode];
    }
    $words .= " ";
}
$words .= "\n";

print $words;
