As the title states, this is my very first attempt at Obfuscation/JAPH so please
don't be gentle with your comments. I had fun creating this and would love to hear constructive criticism that I can apply to my next attempt.
The program below has two functions:
1) If passed an integer (that represents a depth in feet) from the command line it will calculate the Atmospheres Absolute(ATA) for that depth (sea water is assumed).
2) If run without a parameter the program functions as a JAPH should.
This has been tested with v5.8 on Win32 and v5.6.1 on Linux.
-Nitrox
use strict;use warnings;use constant
SCUBA => 33;my(
$SCUBA_TANK,$SCUBA,$SCUBA_,%SCUBA,@SCUBA,$DIVE,$S);sub merge{
$SCUBA_TANK=$_[-1]}$SIG{__WARN__}=sub{merge($_[-1])},$S.=$S,
$SCUBA_TANK=~/(\d+)/,$S=sub{foreach(reverse@_){
$SCUBA[$1*2].=substr($SCUBA[$1],$_+10,1)}
$SCUBA[$1*2]};map{$DIVE.=chr(hex($_)+SCUBA)if($_)}reverse split /(..)/
+,"51444A4240";
$SCUBA[0]="Atmospheres Absolute";$SCUBA{TANK}=$1*2;
$SCUBA=submerge()||&merge_;sub submerge{
$SCUBA_++if$ARGV[0];return$ARGV[0]||undef}if(
$SCUBA_){$SCUBA=sprintf("\nDepth: %d(fsw) = %.2f $SCUBA[0](ATA)\n\n",$
+ARGV[$#ARGV],(++(
$SCUBA/=33)))}sub merge_{$SCUBA[$1]=$SCUBA[-1],
$SCUBA[$1]=~y,mb,nJ,,&$S(2,1,8,4,7,3),&$S(-22,-23,-24,-29,-27,-28),($_
+)=$^X=~/(\w{4})(\..*)?$/,s/^(.)/\u$1/;
$SCUBA[$SCUBA{TANK}].=" $_ H".$DIVE}print
$SCUBA;