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;

In reply to First timer... by Nitrox

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.