Just another Perl JAPH,
No replies — Read more | Post response
|
by tobyink
on Nov 16, 2012 at 12:00
|
|
|
use 5.016;use strict;$_+=$^F;1980=~/(..)(..)/;@$=('a'..'z')x($_**$_);$
+"=q[];say
map qq(@$_ ),[map$$[$_+ord($;)],-$1,-8,-$1/2,$1=~s/1/-/r]=>[$$[0],$$[o
+rd q$'$],
chr(!!$^F x 3),"@{[@$[1985=~/(..)(..)/i]]}",$.=reverse're']=>[$$[-1+or
+d($.)/6],
$.,q@l@]=>[$$[ord($.)/3],$$[$-],$$[--$^F+!!$=],$$[$_+$=].$..q.,.] # qw
+(tobyink)
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
|
meta JAPH
No replies — Read more | Post response
|
by ColonelPanic
on Nov 15, 2012 at 10:05
|
|
|
I am having too much fun, but here is another one:
#!/usr/bin/perl
$_=q|trdKVO99Rhlokd:trdGSLK99O`qrdq:#o<GSLK99O`
qrdq,=mdv'cde`tks^g<=Zrtaz#^<rghes:#^%%'r.[Zcnv
mkn`c[\..+du`k(\|+&csdws&\(:fds'!gsso9..vvv-odq
klnmjr-nqf.>mncd^hc<#^Z/\!(<}.;oqdbk`rr<!bncd!=
'-)>(;[.oqd=.r:#o,=o`qrd'#0(|;sub AUTOLOAD{@_?(
$_=~s/(.)\n?/chr(ord($1)+1)/egx,eval):AUTOLOAD(
$AUTOLOAD=~s/\D//gr);}&split5and5and5chop6chop6
Ok, string mangling is rather unoriginal, but observe how small changes can lead to a very different result:
#!/usr/bin/perl
$_=q|trdKVO99Rhlokd:trdGSLK99O`qrdq:#o<GSLK99O`
qrdq,=mdv'cde`tks^g<=Zrtaz#^<rghes:#^%%'r.[Zcnv
mkn`c[\..+du`k(\|+&csdws&\(:fds'!gsso9..vvv-odq
klnmjr-nqf.>mncd^hc<#^Z/\!(<}.;oqdbk`rr<!bncd!=
'-)>(;[.oqd=.r:#o,=o`qrd'#0(|;sub AUTOLOAD{@_?(
$_=~s/(.)\n?/chr(ord($1)+1)/egx,eval):AUTOLOAD(
$AUTOLOAD=~s/\D//gr);}&split9join9chop75chop88;
And there are many other possibilities, too.
I have to credit Athanasius for his help on this one.
When's the last time you used duct tape on a duct? --Larry Wall
|
Too Obvious?
No replies — Read more | Post response
|
by ColonelPanic
on Nov 08, 2012 at 07:48
|
|
|
It's been eight years since I've posted anything on this site. Here is one just for old times' sake:
$_=q chop ($b,$r);$/--#ac.'';y$near) h.g($_+ 0;e;0en$.' Perl';my
$w="Another$/Just ".qq g q qq g;$d='3.l4159!=Hacker';$d=~s/[\d l
]/./gix;$e.=' eva'.($d=~s/[a-i]//gi|$d=~y/=!rn/.()J/?'l;':'s/t//
').' '.($d=~s/k//+eval '$d=~y/P/H/'? '$_= <$b>;s a$da$1ags':new);
eval$e;print;#my Japh done?
When's the last time you used duct tape on a duct? --Larry Wall
|
JPEG Zig-Zag
No replies — Read more | Post response
|
by blackle
on Oct 29, 2012 at 13:07
|
|
|
For the last week I've been trying to figure out an algorithm for JPEG's zig-zag spacefilling curve. Specifically, I wanted an algorithm that maps all elements in an NxN matrix to a N*N array given their x and y values. I finally figured it out with the help of my analysis 101 TA. He's not a computer scientist, but he knows what pairing functions are. Anyway, after a few hours messing with perl, I made this subroutine:
sub getPos{
($x,$y,$s)=@_;($d=$x+$y)*($d++)/2
+($d%2?$y:$x)-($d>$s)*($d-$s)**2
}
To use it, you do something like this:
for(my $x = 0; $x < $size; $x++){
for(my $y = 0; $y < $size; $y++){
print getPos($x, $y, $size)." ";
}
print "\n";
}
For $size = 10 the loop will yield:
0 1 5 6 14 15 27 28 44 45
2 4 7 13 16 26 29 43 46 63
3 8 12 17 25 30 42 47 62 64
9 11 18 24 31 41 48 61 65 78
10 19 23 32 40 49 60 66 77 79
20 22 33 39 50 59 67 76 80 89
21 34 38 51 58 68 75 81 88 90
35 37 52 57 69 74 82 87 91 96
36 53 56 70 73 83 86 92 95 97
54 55 71 72 84 85 93 94 98 99
The body of getPos has 65 (non-whitespace) characters, any ideas on how to get it even smaller?
UPDATE:
This prints a JPEG zig-zag when $ARGV[0] is the size of the matrix:
$==pop;print map{$y=$_;map(($d=$y+$_)*$d++/2-($d>$=)*($d-$=)**2+($d&1?
+$_:$y).$",@m),$/}@m=0..$=-1
97 characters! I started at 125!
|
Progressive JAPH
4 direct replies — Read more / Contribute
|
by Athanasius
on Oct 06, 2012 at 02:41
|
|
|
OK, I’m sure this sort of thing must have been done before. But — well, it was a lot more fun to code it myself than to search for someone else’s implementation ;-)
#! perl -w
use strict;use Time::HiRes"usleep";sub o
($){hex$_[0]}++$|;my@t=(q,4a75737420,.qq
;616E6f74686572205065726c206861636B65;.q
,722c,)=~m,(..),xg;our($0,@c)=qq;%X;;sub
_{print(qq,\r,,join('',map{chr hex}@c));
usleep(274**2)}sub r{sprintf($0,int(rand
0x5e)+040);}$c[$_]=r for+0..$#t;_;my@z=(
-0..$#c);sub n{my($O)=@z;do{$O++if(o$c[$
_]==o$t[$_])}for@z;$O}do{for(@z){$c[$_]=
r unless(o$c[$_]==o$t[$_])}},_ while@t>n
Enjoy!
Athanasius <°(((>< contra mundum
|
Dual language
4 direct replies — Read more / Contribute
|
by smeezekitty
on Sep 22, 2012 at 01:26
|
|
|
I hope this is the right place for this. I have been messing with perl a bunch today a managed to take advantage of how Perl and C use different comment characters.
Here are two methods to write a program that runs as either C or Perl:
#include <stdio.h> // prints 99 Bottles of beer on the wall. Works as
+either a C or a Perl program.
#define PERL C /*
"*/
int main(){//"; {
int $bottles;
$bottles=99;
while($bottles){
printf("%d bottle%s of beer on the wall, %d bottle%s of beer.\
+n", $bottles, $bottles==1?"":"s", $bottles, $bottles==1?"":"s");
printf("Take one down and pass it around, ");
if($bottles==1){
printf("no more bottles of beer on the wall.\n\n");
}
else{
printf("%d bottle%s of beer on the wall.\n\n", $bottles-1,
+ $bottles==2?"":"s");
}
$bottles--;
}
printf("No more bottles of beer on the wall, no more bottles of be
+er.\n");
printf("Go to the store and buy some more, 99 bottles of beer of t
+he wall.");
}
and using a bit different method:
#include <stdio.h>
#define sub void
#define $x char *$t
#define chomp gets
sub main(){
$x;
printf("Please enter your name: ");
#if 0
$t = <>;
#endif
chomp($t);
printf("Hello, %s!", $t);
}
#if 0
main();
#endif
|
My first JAPH
1 direct reply — Read more / Contribute
|
by smeezekitty
on Sep 21, 2012 at 01:36
|
|
|
I don't know if something like this has been done before but:
no warnings;@N=(0..9,'a'..'z');%N=map{$N[$_]=>$_}0..$#N;sub esabot{
$b=6*6;$n=shift;$R="";while($n>0){$R=$N[$n%$b].$R;$n=int($n/$b);}retur
+n$R;}
$SWNFZVDCVL=0xE22AD;$BVWEIQUHMO=0x566D77163;$NSANMOBGBP=0x121701;$GSPB
+PGWHWT=0x3E4E2053;
$TXHU=esabot($SWNFZVDCVL);$TXHU=~s/j/J/g;$XZFG=esabot($NSANMOBGBP);$XZ
+FG=~s/p/P/g;
print$TXHU.' '.esabot($BVWEIQUHMO).' '.$XZFG.' '.esabot($GSPBPGWHWT)."
+,";
|
BEGIN {}
No replies — Read more | Post response
|
by GlitchMr
on Aug 20, 2012 at 14:39
|
|
|
Nothing special, but I thought I will post really simple JAPH just to do anything :).
BEGIN{''=~('RQKkCx0KF=/:^V/q_($I:&bl)ga<[H6!dqEkI]eiQ&s3+*dW&::ra8CE'
.'0kpdA]?Lk.CZDT]n4:jDn!kpilJBWg*x|I5$fJS"ULkwImV>lmwsmR,(x|Lc9wAGT'.
'W;/BVGr42.hVnwk(sC<jv3QPP=]Q_nT!/!?BgRq8.K-)60Ag1wA-L!+A,HRV*:$r_E^'
.'xXSH;BRyGb'^'zn0LdENcaoMnlev"lELwpn$Rk.&rcvpM<(n5cp;Byg.MgX=yZb@L'.
']XsmFUFOicXd1~%uiwhDxr4n/f<QUB.kf2fO^~kcB#;S>~[>n3qD1B52]okgZ7u__(m'
.'agqfc$jzYsLl$k.:XYQalZ>krt)Mr#6T5GLHR`2mP~R2ONHGjUtEcZ>IAjP-<yqw`'.
'I82cTlj(v"uP:K') }sort print die q tie use require reverse scalar uc
|
haiku errors
2 direct replies — Read more / Contribute
|
by drpaz
on Jul 18, 2012 at 12:15
|
|
|
Now I have to work all night on what I _should_ have been doing. Nevermind, this was more fun. I found the old haiku error messages and wanted to write a 'fortune' style thing to display one at random. Then I thought I could ask wikipedia for the Japanese Character for 'Haiku' and write the code like that. I did it, but it was far too many rows and columns. I'm sure I could do it with compression but for now, just repeating the character is fine. No apologies at all for the unused vars, fake code and unreachable nonsense. It's obfu, after all!
$h=q %
S6/6 1+15/2+1 6/2+16/51 +17
/2+18/2+ 28/37+=/ 6/81+=T3/ 6+7/29+9/2
3+14/48+ 15/25+17/ 57+18/56+ 19/2+19/6+
19/40+20/ 2+21/2+2 2/2+23/2+ 24/2+25/2+
26/2+28/1 1+30/23+ 31/56+=a1 /5+1/46+2/
11+3/25+ 3/31+3/3 9+3/49+3/ 54+4/4+4/41+4/62+5/10+5/59+5/68+6/41+7/39+7/47+
7/68+8/3 +8/23+8/ 37+8/48+8 /65+8/70+9/3+9/16+10/43+11/10+13/16+13/31+13/34+
13/36+13/ 48+13/52+13/59+14/ 3+14/11+14/14+14/25 +14/42+15/15+15/19+15/34+15/65+15/67+16/33+16/40+
16/44+16/70+16/76+18/4+18/12 +19/7+19/12+19/41+2 0/26+20/38+21/12+21/75+22/15+22/39+22/58+22/69+23/
11+23/15 +23/24+23/30+23/52+ 23/57+24/13+24/66+2 5/15+25/23 +25/31+25/
37+25/43 +25/53+25/55+25/72 +26/6+26/45+27/8+27 /23+27/35+ 27/60+27/6
7+28/15+2 8/25+28/ 49+28/64+ 28/77+29/9+ 29/29+29/49
+30/9+30/ 26+30/66 +31/22+31 /36+31/42+ 31/62+=N11/
2+17/26+22 /53+26/5 2+28/10+2 8/55+29/63+=,4/31+4/39+7/12+8/5+8/25+ 8/45+8/60+9
/20+12/47+1 4/45+17/ 66+19/43+ 21/22+21/51+22/61+22/66+24/48+25/34+25/ 41+26/63+31
/24+=d1/11+4 /43+4/56+5/21+6/49 +6/57+7/41+7/43+7/ 57+8/36+9/19+9/27+9/70+11/12+12/32+13 /17+13/26+1
3/61+14/29+1 4/57+14/75+15/33+1 5/51+16/37+16/47+1 6/62+1 7/61+18/71+20/41+20/50+21/8+2 1/33+21/37+
22/17+22/36+2 3/32+23/65+24/25+2 4/32+24/62+24/73+2 5/45 +25/52+25/82+26/25+27/5+27/49 +28/5+28/19
+29/31+29/78 +30/8+30/20+30/25+ 30/51+31/49+=Y3/45 + 6/23+19/5 2+30/2+31 /2+=E3/7+5/
2+6/2+=j26/6 8+=Z11/43+=y1/18+2 /35+3/34+3/55+5/39 +5/54+5/6 1+6/6+6/5 5+6/78+7/76
+9/36+9/67+1 0/23+10/ 44+10/59+ 11/7+12/1 4+12/46+1 3/18+13/62+
15/10+18/5+ 18/46+20 /15+21/39 +22/41+24 /39+24/80 +26/70+27/1
8+28/68+29/ 61+30/10 +30/27+=" 14/61+14/ 77+29/59+ 29/68+=111
/2 8+=u1/12 +1/20+1/ 37+2/37+2 /41+2/47+ 3/36+3/47 +3/62+4/69+
5/17+5/4 1+6/25+6/63+7/37+7/6 9+7/73+9/30+9/38+9/5 3+11/39+12/3+12/51+13/24+14/2 8+14/73+15
/20+15/2 9+15/45+16/7+16/28+1 7/31+17/39+17/64+17/ 70+18/21+18/48+19/37+19/45+19 /54+20/17+
20/44+21 /41+21/47+21/55+22/1 3+24/41+24/51+24/82+ 25/60+25/78+26/23+26/40+26/58 +27/68+28/
34+28/70 +29/76+31/4+31/28+=k 3/51+6/38+9/46+11/5+ 12/45+15/36+16/78+17/34+18/66 +20/22+21/
76+30/18 +30/42+30/61+=g2/16+ 2/25+2/60+4/11+5/66+ 6/11+6/16+6/72+6/73+9/7+9/49+ 10/4+11/49
+11/57+1 4/43+15/ 7+15/12+1 5/30+15/4 1+15/61+15/
66+17/40 +19/60+2 1/21+22/2 3+22/34+2 2/72+23/66+
25/12+26 /49+26/5 9+26/60+2 7/30+27/55+29/15+30/45+31/63
+=t1/38+ 1/43+1/5 6+2/9+2/1 2+2/21+2/27+2/48+2/55+3/15+3
/29+3/32 +3/57+4/ 17+4/30+4 /38+4/50+4/68+5/32+5/34+6/7
+6/52+6/ 69+7/6+7 /14+7/34+ 7/70+8/12+8/32+8/57+9/34+9
/55+9/66 +10/16+1 0/31+10/4 9+10/53+10/61+11/20+11/
25+11/30 +11/36+1 2/4+12/26 +12/34+12/52+13/6+1
3/12 +13/35+1 4/4+14/9+ 14/
69+15/16 +15/22+1 6/26+16/2 9+16/67+17
/28+17/6 5+18/3+18 /7+18/13+ 18/17+18/3
2+18/33+1 8/40+18/ 62+19/10+ 19/13+19/2
9+19/31+1 9/35+19/ 47+19/68+ 20/12+20/3
0+20/39+ 20/45+20 /57+20/67 +21/26+21/50+21/56+21/58+22/6+22/10+22/19+22/49
+22/55+2 2/63+23/ 43+23/50+ 23/60+24/9+24/34+24/52+24/54+24/70+24/77+25/8+25
/22+25/32 +25/36+25/50+25/54 +26/37+26/41+26/56+ 27/9+27/24+27/25+27/34+27/39+27/42+27/59+27/61+27
/70+28/28+28/50+29/4+29/33+2 9/72+30/5+30/13+30/ 30+30/37+30/64+30/67+31/7+31/14+31/19+31/29+31/31+
31/37+31 /71+=e1/10+1/14+1/2 3+1/26+1/31+1/39+1/ 53+1/59+2/ 7+2/30+2/3
3+2/39+2 /63+3/10+3/23+3/41 +4/9+4/25+4/28+4/34 +4/36+4/46 +4/57+4/67
+5/12+5/2 0+5/26+5 /35+5/45+ 5/47+5/71+6 /4+6/19+6/3
1+6/45+6/ 46+6/50+ 6/56+6/64 +6/65+6/67 +6/74+6/79+
7/16+7/22+ 7/25+7/5 3+7/54+7/ 59+7/67+8/9+8/14+8/19+8/29+8/34+8/44+ 8/54+8/59+8
/64+8/67+9/ 10+9/11+ 9/14+9/18 +9/25+9/32+9/41+9/44+9/45+9/62+9/65+9/6 9+10/14+10/
26+10/29+10/ 35+10/38+10/47+10/ 50+10/62+11/6+11/1 6+11/18+11/40+11/44+11/47+11/52+11/53 +12/10+12/1
9+12/36+12/4 2+12/55+12/58+12/6 0+13/7+13/15+13/29 +13/39 +13/50+13/55+14/6+14/17+14/18 +14/30+14/3
2+14/39+14/44 +14/50+14/52+14/65 +15/3+15/4+15/14+1 5/37 +15/46+15/60+16/3+16/10+16/35 +16/43+16/4
6+16/54+16/5 5+16/72+17/3+17/6+ 17/17+17/23+17/36+ 1 7/52+17/6 0+18/9+18 /15+18/24+1
8/35+18/53+1 8/58+18/61+19/4+19 /19+19/20+19/33+19 /38+19/64 +19/71+20 /4+20/7+20/
13+20/20+20/ 21+20/33 +20/40+20 /48+20/52 +20/59+20 /63+21/4+21
/9+21/34+21 /36+21/4 5+21/48+2 1/60+21/6 9+21/71+2 1/74+22/4+2
2/7+22/44+2 2/54+22/ 60+22/75+ 23/4+23/6 +23/45+23 /54+23/67+
24 /10+24/1 7+24/18+ 24/24+24/ 30+24/35+ 24/45+24/ 47+24/56+24
/60+24/6 8+24/74+24/76+24/78+ 25/5+25/6+25/17+25/2 0+25/30+25/39+25/61+25/81+26/ 8+26/13+26
/28+26/3 3+26/44+26/62+27/12+ 27/33+27/44+27/54+27 /57+28/18+28/30+28/35+28/40+2 8/41+28/48
+28/60+2 8/63+28/76+29/8+29/2 0+29/35+29/39+29/41+ 29/44+29/52+29/55+29/66+30/3+ 30/6+30/19
+30/62+3 1/8+31/16+31/21+31/3 3+31/38+31/48+31/64+ 31/74+31/76+=W5/25+12/18+20/6 +24/29+26/
21+27/2+ 28/2+29/2+30/48+=v1/ 30+2/32+3/40+5/11+6/ 3+9/4+12/59+13/49+16/34+17/5+ 24/23+24/6
7+26/7+2 9/65+31/ 47+=B2/46 +3/3+12/5 0+16/65+21/
54+28/32 +=s1/6+1 /15+1/28+ 1/48+1/55 +2/38+2/58+
3/22+3/5 0+4/6+4/ 13+4/60+5 /7+5/73+6/14+6/33+6/42+6/51+
6/80+7/5 +7/8+7/1 9+7/32+7/ 38+7/50+7/60+7/63+8/66+9/17+
9/43+9/5 4+10/33+ 10/40+10/ 56+10/58+10/60+11/17+12/23+
12/44+14 /40+14/4 1+14/51+1 4/58+15/54+16/8+16/22+16/3
0+16/39+ 17/9+17/ 18+17/22+ 17/51+17/76+17/77+18/23
+18/44+1 8/69+19/ 16+19/18+ 19/25+19/65+20/10+2
0/19 +20/53+2 0/54+20/6 1+2
0/66+21/ 13+21/31 +21/49+21 /66+22/14+
22/24+22 /46+22/48 +22/56+22 /70+23/9+2
3/16+23/3 4+23/47+ 24/5+24/7 +24/14+25/
13+25/40+ 25/49+25 /62+25/63 +25/73+26/
18+26/55 +27/13+2 7/21+27/3 7+27/53+28/8+28/16+28/66+28/73+28/79+29/7+29/21
+29/25+2 9/26+29/ 40+29/51+ 30/4+30/33+30/54+30/57+31/6+31/18+31/43+31/59+31
/67+=#1/1 6+1/41+1/62+2/18+2 /44+2/66+3/17+3/43+ 3/67+4/22+4/52+4/74+5/23+5/56+5/76+6/21+6/59+6/87
+7/27+7/61+7/79+8/20+8/50+8/ 73+9/21+9/50+9/73+1 0/18+10/45+10/66+11/21+11/41+11/60+12/16+12/48+12/
69+13/20 +13/45+13/65+14/20+ 14/46+14/79+15/23+1 5/55+15/71 +16/16+16/
49+16/81 +17/24+17/55+17/82 +18/25+18/54+18/76+ 19/22+19/5 0+19/75+20
/23+20/46 +20/69+2 1/23+21/5 2+21/79+22/ 25+22/51+22
/78+23/18 +23/41+2 3/69+24/2 7+24/63+24 /85+25/27+2
5/57+25/85 +26/19+2 6/50+26/7 2+27/19+27/51+27/72+28/21+28/53+28/82 +29/27+29/5
7+29/81+30/ 21+30/46 +30/69+31 /25+31/54+31/79+=H8/2+8/22+8/47+8/69+9/ 2+11/23+13/
47+22/27+=?2 /17+6/85+11/58+13/ 63+22/50+=c1/3+1/1 3+1/33+3/63+4/29+5/15+5/16+7/24+7/51+ 9/29+10/10+
10/15+10/30+ 11/33+16/27+16/52+ 17/33+18/19+20/25+ 20/37+ 21/6+21/28+21/62+22/57+23/13+ 23/23+23/38
+23/56+25/19+ 25/68+25/76+25/77+ 27/7+27/10+27/22+2 8/13 +28/38+28/74+29/11+29/17+29/4 3+29/54+=q6
/62+17/30+21 /46+=D3/8+25/29+28 /47+=b2/14+2/29+4/ 4 7+6/44+7/ 66+9/9+9/ 61+11/8+13/
28+14/16+15/ 43+15/59+16/74+17/ 47+17/73+19/56+20/ 8+20/32+2 0/43+23/2 6+23/62+24/
16+24/50+26/ 27+29/50 +31/27+=I 2/20+15/5 7+19/24+2 1/25+28/23+
=G25/59+=(6 /77+=z5/ 60+6/66+= F7/2+11/2 7+14/62+= w2/52+3/53+
4/15+5/28+5 /43+5/52 +6/35+7/1 1+9/59+12 /21+12/38 +12/54+12/
63 +14/54+1 5/48+15/ 53+17/50+ 18/37+18/ 63+18/73+ 21/11+21/15
+21/68+2 1/73+22/29+23/51+24/ 43+24/59+25/65+26/35 +27/46+28/7+30/15+30/39+30/53 +31/35+=r1
/4+1/9+1 /21+1/40+2/34+3/14+4 /8+4/33+4/45+4/55+4/ 58+4/66+4/70+5/3+5/4+5/6+5/18 +5/19+5/46
+5/50+5/ 64+5/67+5/72+6/5+6/2 6+6/37+6/53+6/70+6/7 5+7/4+7/48+7/52+9/15+9/40+9/6 4+10/12+10
/13+10/2 7+10/39+10/51+11/11+ 11/15+11/54+12/13+12 /61+13/3+13/8+13/14+13/40+13/ 41+13/43+1
4/7+14/2 3+14/27+14/33+14/34+ 14/36+14/56+15/13+15 /27+15/35+16/4+16/11+16/12+16 /14+16/25+
16/45+16 /53+16/7 1+17/4+17 /7+17/14+ 17/16+17/45
+17/48+1 7/53+18/ 22+18/39+ 18/49+18/ 52+18/65+19
/36+19/5 7+19/63+ 19/72+20/ 60+21/35+21/42+21/44+21/70+2
2/45+23/ 5+23/25+ 23/53+23/ 63+24/46+25/4+25/16+25/21+25
/79+25/8 0+26/14+ 26/15+26/ 17+26/57+27/27+28/14+28/39+
28/65+28 /71+28/7 5+29/10+2 9/38+30/7+30/17+30/41+31/2
0+31/39+ 31/75+=: 3/16+14/5 9+25/26+27/50+29/56+=x1
/24+20/6 4+25/38+ =M9/52+16 /59+29/60+=h1/7+2/1
0+2/ 26+3/30+ 3/38+3/64 +4/
3+4/18+4 /61+5/9+ 5/44+5/53 +6/8+6/40+
7/15+7/3 0+7/35+8/ 13+8/33+8 /58+9/24+1
0/54+12/2 4+12/29+ 12/35+12/ 39+13/58+1
4/5+14/10 +14/49+1 5/26+15/3 1+16/23+16
/32+16/6 8+17/41+ 18/8+18/4 1+18/57+19/3+19/11+19/32+19/66+20/3+20/58+21/3+
21/59+21 /63+22/3 +22/11+22 /20+22/68+23/3+23/14+23/44+24/3+24/12+24/44+24/5
5+24/65+2 5/3+25/9+25/33+25/ 66+25/69+25/71+26/5 +26/38+27/11+27/43+28/17+28/29+28/51+28/62+29/5+2
9/12+29/34+30/65+31/15+31/32 +31/41+31/57+31/73+ =C3/19+4/2+13/22+=.1/60+2/43+2/64+3/42+3/65+4/21+4
/51+4/72 +5/22+5/55+5/74+6/5 8+7/26+7/77+9/71+10 /17+10/64+ 12/15+12/6
7+13/19+ 13/44+14/76+16/15+ 16/48+16/57+16/63+1 6/79+17/54 +17/80+19/
73+21/77+ 22/76+24 /26+24/83 +25/56+25/8 3+28/20+28/
52+28/80+ 29/79+31 /53+31/77 +=;6/20+=L 5/58+10/2+=
f2/4+2/40+ 3/11+3/1 2+4/26+6/ 30+7/72+8/16+8/41+10/28+12/7+13/33+14 /71+15/18+1
7/43+18/28+ 19/62+23 /21+23/49 +26/32+27/66+28/45+29/47+29/74+=i1/29+1 /49+2/5+2/1
5+2/24+2/54+ 2/57+4/10+4/16+4/1 9+6/9+6/13+6/29+6/ 71+7/3+7/20+7/31+7/58+7/71+8/17+8/42+ 9/5+9/47+10
/5+10/8+10/5 5+11/24+11/37+11/5 0+11/55+12/22+12/6 4+13/4 +14/63+15/5+15/39+15/49+15/62 +15/68+16/5
+16/38+16/60+ 17/32+17/58+18/14+ 18/31+18/43+18/51+ 18/6 8+19/15+19/48+19/58+20/11+20/ 65+21/16+21
/19+21/32+21 /64+22/21+22/47+23 /8+23/35+23/37+23/ 6 4+24/4+24 /8+25/10+ 25/24+25/67
+26/31+26/36 +26/47+27/3+27/16+ 27/28+27/47+27/62+ 28/3+29/3 +29/13+30 /12+30/29+3
0/32+30/43+3 0/49+30/ 56+30/60+ 31/11+31/ 58+31/66+ =A1/1+2/2+3
/2+16/18+=n 1/27+1/5 8+2/50+2/ 62+4/12+4 /20+4/37+ 4/42+4/71+5
/30+6/10+6/ 18+6/47+ 6/82+7/9+ 7/17+7/23 +7/40+7/5 5+8/10+8/3
0+ 8/39+8/5 5+9/6+9/ 12+9/33+9 /48+9/57+ 10/6+10/9 +10/21+10/4
8+11/19+ 11/35+11/38+11/45+11 /48+11/51+11/56+12/5 7+13/5+13/10+13/56+13/60+14/1 2+14/67+14
/74+15/6 +15/38+15/40+15/50+1 5/63+15/69+16/56+16/ 61+16/77+17/21+17/37+18/16+18 /60+18/74+
19/21+19 /27+19/46+19/59+19/7 0+20/27+20/28+20/49+ 21/20+21/30+22/8+22/16+22/22+ 22/33+22/4
0+22/74+ 23/28+23/31+23/40+23 /58+24/19+24/57+25/1 1+25/25+25/44+26/10+26/46+26/ 48+26/65+2
7/4+27/2 9+27/48+27/58+27/64+ 28/4+28/42+28/59+29/ 14+29/30+29/42+29/53+29/70+29 /77+30/35+
30/44+30 /50+31/1 2+31/52+3 1/69+=O3/ 4+4/54+10/2
0+12/2+1 4/22+18/ 27+=&1/2+ 1/8+1/17+ 1/22+1/32+1
/42+1/45 +1/47+1/ 54+1/61+1 /63+2/1+2/3+2/8+2/13+2/19+2/
22+2/28+ 2/31+2/3 6+2/45+2/ 49+2/53+2/56+2/59+2/65+2/67+
3/1+3/9+ 3/18+3/2 4+3/28+3/ 33+3/37+3/44+3/48+3/52+3/56
+3/60+3/ 66+3/68+ 4/1+4/7+4 /14+4/23+4/32+4/40+4/44+4/
53+4/59+ 4/65+4/7 3+4/75+5/ 1+5/8+5/13+5/24+5/27+5/
33+5/38+ 5/42+5/4 8+5/51+5/ 57+5/62+5/75+5/77+6
/1+6 /12+6/15 +6/22+6/2 7+6
/34+6/39 +6/43+6/ 48+6/60+6 /68+6/76+6
/86+6/88 +7/1+7/7+ 7/13+7/18 +7/28+7/33
+7/42+7/4 9+7/56+7 /62+7/65+ 7/78+7/80+
8/1+8/6+8 /11+8/15 +8/21+8/2 6+8/31+8/3
5+8/40+8 /46+8/51 +8/56+8/6 1+8/68+8/72+8/74+9/1+9/8+9/13+9/22+9/26+9/35+9/
42+9/51+ 9/56+9/6 0+9/63+9/ 72+9/74+10/1+10/7+10/19+10/24+10/32+10/41+10/46+
10/52+10/ 57+10/65+10/67+11/ 1+11/4+11/13+11/22+ 11/26+11/29+11/32+11/42+11/46+11/59+11/61+12/1+12
/5+12/8+12/17+12/20+12/25+12 /28+12/33+12/37+12/ 43+12/49+12/53+12/56+12/62+12/68+12/70+13/1+13/9+1
3/13+13/ 21+13/27+13/30+13/3 2+13/38+13/46+13/51 +13/53+13/ 57+13/64+1
3/66+14/ 1+14/8+14/13+14/15 +14/21+14/24+14/26+ 14/31+14/3 7+14/47+14
/53+14/60 +14/66+1 4/70+14/7 8+14/80+15/ 1+15/8+15/1
1+15/17+1 5/24+15/ 32+15/42+ 15/47+15/5 6+15/58+15/
64+15/70+1 5/72+16/ 1+16/9+16 /17+16/21+16/31+16/36+16/50+16/58+16/ 64+16/69+16
/73+16/80+1 6/82+17/ 1+17/10+1 7/15+17/25+17/29+17/35+17/42+17/46+17/5 6+17/62+17/
67+17/72+17/ 81+17/83+18/1+18/6 +18/10+18/18+18/26 +18/29+18/36+18/42+18/45+18/50+18/55+ 18/59+18/67
+18/70+18/75 +18/77+19/1+19/5+1 9/9+19/14+19/17+19 /23+19 /26+19/30+19/34+19/39+19/44+1 9/51+19/55+
19/61+19/67+1 9/74+19/76+20/1+20 /5+20/9+20/14+20/1 8+20 /24+20/31+20/34+20/42+20/47+2 0/55+20/62+
20/68+20/70+ 21/1+21/5+21/10+21 /14+21/24+21/27+21 / 38+21/43+ 21/53+21/ 57+21/61+21
/67+21/72+21 /78+21/80+22/1+22/ 5+22/9+22/18+22/26 +22/30+22 /35+22/38 +22/42+22/5
2+22/62+22/6 7+22/71+ 22/77+22/ 79+23/1+2 3/7+23/10 +23/12+23/1
9+23/22+23/ 29+23/33 +23/42+23 /46+23/55 +23/61+23 /68+23/70+2
4/1+24/6+24 /11+24/1 5+24/20+2 4/28+24/3 3+24/38+2 4/42+24/49
+2 4/53+24/ 58+24/64 +24/69+24 /72+24/79 +24/84+24 /86+25/1+25
/7+25/14 +25/18+25/28+25/35+2 5/42+25/46+25/51+25/ 58+25/64+25/70+25/74+25/84+25 /86+26/1+2
6/4+26/9 +26/12+26/20+26/26+2 6/29+26/34+26/42+26/ 51+26/54+26/64+26/67+26/71+26 /73+27/1+2
7/6+27/1 4+27/20+27/31+27/38+ 27/41+27/45+27/52+27 /65+27/71+27/73+28/1+28/9+28/ 12+28/22+2
8/24+28/ 27+28/31+28/36+28/43 +28/46+28/54+28/57+2 8/61+28/67+28/72+28/81+28/83+ 29/1+29/6+
29/16+29 /22+29/28+29/32+29/3 6+29/45+29/48+29/58+ 29/62+29/69+29/73+29/80+29/82 +30/1+30/1
1+30/14+ 30/22+30 /28+30/31 +30/34+30 /38+30/47+3
0/55+30/ 58+30/63 +30/68+30 /70+31/1+ 31/5+31/10+
31/13+31 /17+31/2 6+31/30+3 1/34+31/40+31/44+31/50+31/55
+31/60+3 1/65+31/ 68+31/72+ 31/78+31/80+=P13/2+=m1/35+1/
50+2/23+ 3/61+5/6 9+5/70+8/ 38+9/31+10/42+10/63+12/9+12
/11+14/3 8+15/9+1 7/59+17/7 1+17/79+23/17+24/21+26/43+
27/56+28 /26+28/7 8+29/19+3 1/23+31/45+=l1/52+2/6+2
/42+3/20 +3/26+3/ 27+4/27+4 /63+4/64+5/36+5/37+
6/28 +7/21+7/ 45+7/46+7 /74
+7/75+8/ 4+8/18+8 /24+8/43+ 8/49+8/63+
8/71+10/ 22+10/36+ 10/37+12/ 31+12/41+1
2/65+12/6 6+13/25+ 13/37+14/ 64+15/21+1
5/44+16/1 9+16/20+ 16/75+17/ 69+17/74+1
8/30+18/ 34+19/49 +20/35+20 /51+21/17+21/18+22/31+23/36+24/36+24/37+24/75+2
5/47+26/ 24+26/30 +26/61+27 /15+27/17+27/36+27/69+28/33+29/23+29/67+30/59+=p
1/25+1/36 +1/51+4/35+5/63+8/ 8+8/28+8/53+8/62+9/ 68+10/25+10/34+11/14+13/54+14/19+16/41+16/42+17/1
1+17/19+17/68+18/11+21/65+22 /43+22/59+27/32+29/ 37+31/9+31/61+=)6/84+=R3/5+4/24+14/2+='5/31+6/32+9
/39+17/8 +23/59+24/31+24/61+ 27/26+=o1/19+1/34+1 /44+1/57+2 /51+2/61+3
/13+3/21 +3/35+3/46+3/58+3/ 59+4/5+4/48+4/49+5/ 5+5/14+5/2 9+5/40+5/4
9+5/65+6/ 17+6/24+ 6/36+6/54 +6/83+7/10+ 7/36+7/44+7
/64+8/7+8 /27+8/52 +9/28+9/3 7+9/58+10/ 3+10/11+11/
3+11/9+11/ 31+11/34 +12/6+12/ 12+12/27+12/30+12/40+13/11+13/23+13/4 2+14/35+14/
55+14/68+14 /72+15/2 8+15/52+1 6/6+16/13+16/24+16/66+17/12+17/13+17/20 +17/27+17/3
8+17/44+17/4 9+17/63+17/75+17/7 8+18/20+18/38+18/4 7+18/64+18/72+19/8+19/28+19/42+19/53+ 19/69+20/16
+20/29+20/36 +20/56+21/7+21/29+ 21/40+22/12+22/28+ 22/32+ 22/37+22/64+22/65+22/73+23/20 +23/27+23/3
9+23/48+24/22 +24/40+24/71+24/81 +25/48+25/75+26/3+ 26/1 1+26/16+26/22+26/39+26/53+26/ 66+26/69+27
/40+27/63+28 /6+28/44+28/56+28/ 58+28/69+29/18+29/ 2 4+29/46+2 9/64+29/7 1+29/75+30/
16+30/24+30/ 36+30/40+30/52+31/ 3+31/46+31/51+31/7 0+=%;$h=~ s/\n//g;$ h=~s/\|//g;
$h=~s/\s//g ;chop $h ;chop $h; my $u;@h= split/=/, $h;foreach
my $t(@h) { chop $t; $_c='th'; $___p=""; $_spl=91; $t=~s/(.)//
&& do { $_c=$1;};@_a = split /\+/,$t;foreach (@_a ){m/(\d+)\/(\d+)/ && do {$o=1 ; $u->{$1}
{$2}=$_c ;};}} $h = int(rand( scalar keys %{$u})); foreach my $c (sort {$a<=>$b} keys %{$u->
{$h}}){ my $_R=$u->{$h}{$c}; $_R=~s/&/ /;$haiku=1 ;$_R=~s/#/\n/;print $_R;}#ppp not end if
__END__? my %r=reverse shift @_pp;s/^\&**/_asm(_a mov(a,r);ldr(_,$_);sub(_||$_| unless $q;
poke the badger with a spoon( $sp__{${s_{$s->{'1'} } } }->('eyore'))\+|\+\+++;$_ =\$%r->{|}
|||||||| |||||||||||||||||||| |||||||||||||||||||| ||||||||||||||||||||||||||||| ||||||||||
|||||||| |||||||| ||||||||| ||||||||| |||||||||||
|||||||| |||||||| ||||||||| ||||||||| |||||||||||
|||||||| |||||||| ||||||||| ||||||||||||||||||||||||||||
|||||||| |||||||| ||||||||| ||||||||||||||||||||||||||||
|||||||| |||||||| ||||||||| |||||||||||||||||||||||||||
|||||||| |||||||| ||||||||| ||||||||||||||||||||||||||
|||||||| |||||||| ||||||||| |||||||||||||||||||||||
|||||||| |||||||| ||||||||| |||||||||||||||||||
|
Autoboxing by subclassing CORE
4 direct replies — Read more / Contribute
|
by tobyink
on Jun 20, 2012 at 10:40
|
|
|
{
package String;
use base 'CORE';
use overload
q[bool] => '_deref',
q[""] => '_deref',
q[0+] => '_deref',
fallback => 1,
;
sub new {
my ($class, $str) = @_;
bless \$str => $class;
}
sub _deref {
${$_[0]};
}
}
my $greeting = String->new("Hello World\n");
print $greeting->substr(6);
It's not really obfuscated, but even experienced Perl programmers would probably do a double-take when seeing it, and I couldn't think of a better section to put it in.
By the way, you can also use CORE directly - the subclassing is not strictly necessary.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
|
|