The JAPH log

Dec 6, 2002

We recently hired a new guy, Chip Salzenberg, who is a perl guru of note. He has a ton of perl shirts, and come to think of it, I've not seen him wear anything else outside of the suit on his interview. anyway, it got me hankering for a another Japh. I tried some fancy stuff, but came up with a nice simple one:

',' ',A..Z);$_='372018192728131419070417274332453927'

Jun 17, 2002

I tried compacting Kristy's EVIL JAPH down. I got it three characters smaller, but also added more evil with a map statement, and constructs like "?$/??$_:" and "/(.{6})/g,$/"

map{print ?$/??$_:(($",a..z,A..Z)[ord pack B8,"00".$_])}(unpack
B144,pack H36,"9154d401b38f50815202a7ec9808810cb152")=~/(.{6})/g,$/

Jun 14, 2002

Inspired by Eric's use of strict and an urge to keep things at two lines, Kristy produced this perl pearl:

use strict;$_=qq/ozaxycfstydczcmapbe/;y/fmoz/FMOZ/;s/Za/z/;s/d/mb/;

Isn't it great how obsessive use of $_ still passes strict?

Jun 14, 2002

Now that Eric and Kristy had send JAPHs I felt compelled to add another. This one is nice and compact. I love the "print($a[$a+=$_])" construct.

@a=("\n",' ',a..z,A..Z);map{$a{$_}=$c++}reverse(@a);for(map{$_=~/\d/?$_*-1:$a{$_}}

Jun 14, 2002

Not to be outdone, a good friend of mine, Eric Parkin, felt he add to put in his contribution. Not only is this monster a wonderful mind-bend, but it also uses the strict pragma:

use strict;my $j=reverse(unpack('u',"M-S0X-3\@S.#0S,".
".3\@R-#8T-C0V"));my $x=0;while($x<=((length($j)))){$x
==2?print chr(reverse(substr($j, (length($j)-$x),2))):
reverse(substr($j, (length($j) - ($x-2)),2)==32)?print
chr (reverse(substr($j, (length ($j)-$x),2))):print lc
(chr(reverse(substr($j, (length($j)-$x),2)))); $x+=2;}


Jun 13, 2002

Kristy got inspired. She was unhappy that in most JAPHs there is a very obvious 23 character data set that is just mogrified back to being the phrase. She figured that with the character set represented, you could pack it all into a 6-byte space. And that by mis-unpacking that into 8 bytes, get a shorter data set:

for((unpack B144,pack H36,"9154d401b38f50815202a7ec9808810cb152")=~
/(.{6})/g){print (($",a..z,A..Z)[ord pack B8,"00".$_]);}print "\n";

Truly Evil.

Jun 12, 2002

It inspired me to send this mind-screw to several friends. It is based upon a difference pyramid, a geometric number set as I had learned in a historic math class. I believe it is technically a sigma summation:

(' ',a..z,A..Z){$a{$c++}=$_}print map{$a{$_}}@l1; print "\n";

Jun 12, 2002

It started with Kristina Davis' sig:

$_="z jyf FpJtwQmxMw hUsjWy";while ($a=chop){$a[(&a($a{'a'}))%23]=$a;}
($a=join "","O",@a)=~y/F-Zf-z/A-Ua-u/; print "$a\n"; sub a {$_[0]+=7;}

The beauty of this Japh is it contains and uses: $a, @a, $a[], %a, $a{} and &a.