ref and JAPH
1 direct reply — Read more / Contribute
|
by setebos
on Jan 09, 2009 at 13:08
|
|
|
($\={})=~s/(?<=.).+//&&print+(q/J/,\//=~
/..(\S)/&&$1.$2.($^X=~/.+\/(.)/&&uc($1)))
Thanks to ikegami (the "/" separator is not always the case with $^X):
($\={})=~s/(?<=.).+//&&print+(q/J/,\//=~
/..(\S)/&&$1.$2.($^X=~/\W(.)\w+\.?\w*?$/&&uc($1)))
|
package JAPH
3 direct replies — Read more / Contribute
|
by setebos
on Jan 09, 2009 at 09:35
|
|
|
{$}=(scalar(%::)=~/\/(\d+)/&&$1)}{package JAPH}
print(($_)=[%::]->[$_]=~/(\w+)/,$/)for+($}-2..$}-2)
|
meow for buubot
4 direct replies — Read more / Contribute
|
by jagh
on Dec 20, 2008 at 02:04
|
|
|
This is, of course(!) only meant for a buubot to 'eval: ', due to the wonderful things it stuffs into $_. To be honest, the join bit was a happy accident:
$_=$_->{args}[0],/(meow)/until$\=$1;$\++for 2**8..2**7*(join//,(/(\d)/
+g)[0..4])/22288.2;$\
|
Japhostrophe
1 direct reply — Read more / Contribute
|
by ysth
on Dec 14, 2008 at 14:42
|
|
|
Nothing really obfuscated here, is there?
for ([1,14,12,13],[3,9,10,13,6,5,11],[2,5,11,8],[6,3,4,7,5,11]) {
for (@$_, 15+($$_[0]==6)) {
print substr(H'J'P'a'c'e'h'k'l'n'o'r's't'u => 3*$_ => 1)
|| substr(" ,\n" => $_-15 => $_-14);
}
}
|
JAPH / Perl Rube Goldberg Machine
1 direct reply — Read more / Contribute
|
by eighty-one
on Dec 10, 2008 at 11:51
|
|
|
This script performs a simple task in a needlessly complex manner.
I derived this from some work I did out of spite to annoy a Python-programming friend after a discussion about brackets :)
#!/usr/bin/perl -w
use strict;
my $japh=<<JAPH
[}{{[} {] [] ][[]}] [}[{{]
{{ {] {] [[ }{
[] }] {] {]{}]} [}
{{ [} {] [] ][ []
}] [}[{{] {{[}[[ []
{}{] ]{ {] [}[{]][} [[[}{} [} [{ {][}{] ][{}]}
[} {{ [}{] [] ][ [] }] [} [{ {] {{ {]
[}{]{{{] [} {} ]} [} {{ [} {][]][[] }][}[{ {]{{[}
[[ [] {} {]]{ {] [} [{ {[ [] }] [] }}
[} [{ [] ]{ [][[[}{] {] [} {] ][{}]} [} {{
[}{][] ][[]}] [}[{{] {{
{] {] [[ }{ [] }]
{]{]{} ]}[}{{ [}{][] ][
[] }] [} [{ {]
{{ [}[[[] {} {] ]{{][}
[[ {{ [][[ [}{][] }{ {] [}{]][ {}]}[}
{{ [} {] [] ][ [] }] [} [{ {]
{{{][}{] {{{][}{} ]} [}{{ [}{][] ][[]}
][ }[ {{ ]{ {[ }[ [[ ]{ }{ ]]
{{ ][ }[ {] {[]{[[ ]{ }[ ]]}[][ [[ }{
]{][}{]][{}]}[}{{[}{][]][[]}][}[{{]{{{]{][[}{[]}]{]{]{}]}
JAPH
;my $l=''; my $o='';foreach($japh){chomp; my $len=
length($_);for(my $p=0;$p<$len;$p++){ my $b=substr
($_,$p,1); if($b eq ' '){ next;}$o.= b2bin($b);if(
length($o) == 8){$l.=pack('B8',$o);$o ='';}}}eval(
$l);sub b2bin {my $b = shift; if($b eq '{'){return
'00';} elsif($b eq '['){ return '01';} elsif($b eq
']'){return '10';}elsif($b eq '}'){return '11'; }}
|
Christmas Tree
4 direct replies — Read more / Contribute
|
by spmlingam
on Dec 03, 2008 at 05:29
|
|
|
This code will print Christmas tree
use strict; my ($y,$z);sub tree{my $x=shift;$x=($x>0?-9:
$x);$z=( ($z=($x+5))>0?$z:-$z);printf(!$x&&++$y?"\n":$z?
$z>$y %3+$y/ 3?" ":$x<-5?"/":"\\":$y?"|":"*");$y-9?tree(
++$x): print(" _|_|_\n")&&print(" \\___/\n");}tree(1);
|
Advance Happy New Year 2009
No replies — Read more | Post response
|
by spmlingam
on Dec 02, 2008 at 06:54
|
|
|
#/usr/bin/perl
print pack "H*","416476616e6365204861707079204e6577205965617220323030
+39" ;
|
Celebrating Indian Independence Day
No replies — Read more | Post response
|
by dharanivasan
on Dec 01, 2008 at 01:42
|
|
|
use strict;
use warnings;
my ($a ,$b,$c) = (10,10,10);
for (; ord($a=
substr("Love Your Country+
TFy!QJu ROo TNn(ROo)SLq SLq ULo++
UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^+
NBELPeHBFHT}TnALVlBLO+
FAKFCFQHFOQIAIREET+
MSQGCSQOUHATFAJKSbEALGSkMCSl+
OASn+
^r^r\\tZvYxXy+
T|S~Pn SPm SOn TNn ULo0ULo#ULo-W+
Hq!WFs XDt!YB
",$b+++7,1 ))
;) {
for($a = ord($a); $a-- > 64 ; ) {
print ( chr(++$c == ord('Z') ? $c = $c/9 : 33^$b&1));
}
}
|
very very simple
No replies — Read more | Post response
|
by Oromis92
on Nov 29, 2008 at 06:37
|
|
|
hu, here's my first obfuscated perl code.
It's very simple to understand...
$p=PERL;@p=(24,32,62,35);$P=0
+((1+0)^(0+1))+1;$BP=$P.0;($b
.=chr($p[$_]^ord(substr($p,$_
,$P))))for($P-1..($P+$P)*($P+
$P));$B=substr($b,($P+$P)+$P,
$P);chop($b);chop($b);$b.=chr
($p[$P+$P]^ord(substr($p,$P+$
P,$P))).$B.chr($BP);print $b;
|
Spaceship Zero
1 direct reply — Read more / Contribute
|
by Orchew
on Nov 09, 2008 at 00:40
|
|
|
$x<=>0 ;# sgn($x)
I'm fairly confident that, in perl, that is the shortest possible way to calculate sgn($x).
|