Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

First timer...

by Nitrox (Chaplain)
on Nov 26, 2002 at 03:33 UTC ( [id://215780]=obfuscated: print w/replies, xml ) Need Help??

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;

Replies are listed 'Best First'.
Re: First timer...
by dingus (Friar) on Nov 26, 2002 at 08:37 UTC
    Pity you couldn't use a FLOAT somewhere to counteract all the sub merge()ing :)

    Dingus


    Enter any 47-digit prime number to continue.
      Haha, that would have been classic Dingus! I should have named my constant FLOAT.

      -Nitrox

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: obfuscated [id://215780]
Approved by premchai21
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-25 03:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found