给 perl hacker 们看的(2)

减小字体 增大字体 作者: 2007-11-22  来源:不详


Naturally, I'd like to apply this idea to Perl. Because
non-alphabetic symbols are so important to us, it was
obviously necessary to extend the idea a little. I
analyzed my terminal font, and decided that the characters

  &+-.:<=>acemnorsuvwxz~

went neither too far up nor too far down. Naturally the results
may be a little different for other fonts, but I needed a
standard. So I started to program in this restricted Perl.

It's a frustrating little language, but rather beautiful.

A JAPH:

s==x= && s==.er & xac.uc coer= && s==m--+m--+m--+m--=e &&
s==xac.~o= && s=.+=<<x& evam=ee &&
eva~
x
s=c.=c= && s=x=xz&<<o=e &&
xm
o
s=x=x = && s=x=<<xc& <<xo =e&&
x~
xc
xm
xo
s=x=xer= && s=x=xr& xu=e && s=x=xer = && s=x=xx & uc xn=e &&
s=.=xu & <<o=e &&
x~
o
s=x=x ano= && s=x=xu & <<o=e &&
x~
o
s=x=xus= && s=x=xo & uc xz=e && s=
== && s=.== && s=.+=reverse uc=e && s=.=
r= && s=.+=reverse uc=se &&

warn uc


I wonder whether it would be possible to write a Turing Machine
in this restricted language, demonstrating its algorithmic
completeness.

 .robin.


Notes:
 http://www.kitsite.com/~robin/ou-x-po/talk/perl-prisoner.html

Analyzing font metrics:
 http://www.kitsite.com/~robin/ou-x-po/fontm.c
 http://www.kitsite.com/~robin/ou-x-po/prisoner.pl
%%
#sn@neopoly.de
#received an honourable mention 2000 TPJ Obfuscated Perl Contest
$\=$/,$^X=~m(((.)..l));$~=q,od,,$_='sven@sven.de 2000/01/04'
,$;="/$2$~/$1f\141q".(close STDERR).".$2$~";$#=length,print
map{@ARGV=-f$_.$;?$_.$;:m;();;m>"(j.{$#})>while<>;$+}@INC
%%
#"Christensen, David A. (CHC)" <DChristensen@chc.gov.mb.ca> with thanks to
#Andy Lester
#!/usr/bin/perl
undef $/;@t=split//,<DATA>; print map{$_<0?chr(-$_):$t[$_]} qw
/-74 32 10 11 5 40 41 44 43 75 80 76 27 48 64 65 26 54 7 1 91 -107 69 58/;
__END__
David Christensen
Technical Consultant
Manitoba Public Library Services

%%
#Mark-Jason Dominus http://www.plover.com/

require 5.00553;
use re 'eval';
$|=1;
$z = qr{(?{local$d=1})
        (?:`(?{$d++})
          |.(?{$d--})
        )+?
        (?(?{$d})(?!))
       }x;
$_="``As`SB``Ad``S``BS`BBI``Ae``B`SI`Ed``A?``C``CIi`pI``E?Z``BZZZZZ`KI
```CX`KIZZQZZZQZZZZZQZZZZQZ``BZZ```CX`KX`KXQ``Ee``EeZZZZZQZ```CX`KIZZQ
```CX`KIZZQZZZZQ```CXZ`KIZZQ``Ee```CX`KIZZQ``EdZZZQZ``BZZ```CX`KX`KXQ`
`BZ```CX`KIZZ`KXZQ``Ee```CX`KIZZQ``EdZZZQ``BZZZZ`KXQZ``BZZ```CX`KX`KXQ
``B```CXZ`KIZZ`KXQ``Ee``EeZZZZZQ``B``EeZZZ`KXQ``Ee``EdZZZQ``Ee```CX`KI
ZZQ``EdZZZQ``Ed``Ee```CX`KX`KI";
s/\n//g;s/Q/`KI``E?/g;s/X/IZZZ/g;s/Z/``Es/g;
1 while
  s{`I($z)          (?{$q=0})|``K($z)($z)                    (?{$q=1})
   |```S($z)($z)($z)(?{$q=2})|```B($z)($z)($z)               (?{$q=3})
   |```C($z)($z)($z)(?{$q=4})|``A($z)($z)                    (?{$q=5})
   |`i($z)     (?{$R++,$q=6})|`p($z)(?{print(chr 120-$R), $R=0, $q=7})
   |`E($z)          (?{$q=8})|`V($z)                         (?{$q=9})
   }
   {local $^W;
   $q<5 ?($1,$2,"``$4$6`$5$6","`$7`$8$9","``$10$12$11")[$q]
   :$q==5?($bind{$13}=$14,"")
   :($15,"",$bind{$17},"")[$q-6]
    }ex;
%%
Author:  Mark-Jason Dominus
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f|ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print

[note: Won 2nd place in the 5th annual obfuscated Perl contest.
 see http://perl.plover.com/obfuscated/ for more info. ]
%%
#Yanick Champoux
#http://www.iro.umontreal.ca/~champoux/sigs/
print map chr$_[0]-ord$_,@_='200ocT╣ZYT`cV▁cV\╜ge]cV'=~m;(\d+|.);g;
%%
#Richard Proctor <Richard@waveney.org>
@{$_}=(@{$_-1},1)for(1..9);
map{s/./sprintf"%02d",ord$&/eg}($h,$l)
=("0X\cFMWD\cDDF.CD","\cY\"\cEY*\\\cH\\<\cEK\\");
print chr((@{substr($h,$_,1)}.@{substr($l,$_,1)})+32)for(0..23)
%%
#Richard Proctor <Richard@waveney.org>
sub x{for(split'',"Abigail!"x3){print chr(shift()+ord)}}
x(9,19,10,13,-65,-8,2,78,51,6,-4,11,-65,-25,-7,81,43,-66,-33,-6,2,2,-7,81)
%%
#Gaal Yahas <gaal@forum2.org>
perl -le
   '@Just_another_Perl_hacker=map{/^[^*].*hack/&&s,_, ,g&s,$,\,,&print}%::'
%%
From merlyn@iwarp.intel.com (Randal Schwartz) 1 Feb 90 22:28:58 GMT
@a=split(/(\d)/,"4Hacker,2another3Perl1Just");shift(@a);%a=@a;print "@a{1..4}";
%%
From Andrew.Vignaux@comp.vuw.ac.nz (Andrew Vignaux) 22 Aug 90 11:10:18 GMT
$s=(localtime(time))[0]; sub n { ($a - $b) * $s; }
print grep(s/.*\t//,sort n grep($_=++$i/-50."\t$_",split(/\n*/,<<JAPH)));
,rekcah lreP rehtona tsuJ
JAPH
%%
From merlyn@iwarp.intel.com (Randal Schwartz) 29 Aug 90 19:14:54 GMT
print pack("c*",(32..127)[42,85,83,84,0,65,78,79,84,72,69,82,0,48,69,82,76,0,72
,65,67,75,69,82,12])
%%
Date:         6 Feb 90 22:31:17 GMT
From:         merlyn@iwarp.intel.com (Randal Schwartz)
print grep(s/^\d+(.*)/$1 /, sort(split(/ /,"8hacker, 4Perl 1Just 2another")));
%%
Date:         5 Feb 90 18:08:59 GMT
From:         merlyn@iwarp.intel.com (Randal Schwartz)
%_=split(/(\D+)/,"7Perl6another8hacker,5Just");print"@_{5..8}";
%%
From:         merlyn
print pack('C25', grep($_ && $_ -= 256, split(/(\d\d\d)/, <<STRANGE)));
330373371372288353366367372360357370288336357370364288360353355363357370300
STRANGE
%%
Date:      &n