|
|
Two programs I wrote for the Perl Journal's Obfuscated Contest, edition 2000.
galgen is an implementation of the traditional game of hangman. (tarball of the submission)
$p=uc shift;s/\d/' 'x$&/gefor@c=split'@',('%'x30).'+----,-%|4!%|4!%|4O%|3<|>%|4^%|3/1\%==o-----===@y.<.1.;s:1O:<O:@s^!%^!1*g*%^;s#!%#!1/%#@s!1\*g\*!!;s,2!1/,`1!1\',;s"2<O"-1<O1-"@y|>|1|;s+O+O>+@y-`\'-1-d;s&-1<O>1-&3`-O&;s;\|4\|;|2--1<|\\\\;;s*\^%*2$&*;s./1\\\\.2/ >.@s+-O+...O+;s.-- <\|\\\\.5/\|>.;s|\^%|2$&|;s./ >.2/1\\\\.g;s=-----=5=;s.$.%2|.';$_=shift@c;while(1){($c=$p)=~y.`-|._.c;($\=join' ',"$_%",keys%l,"%%$c%>")=~y/%/\n/;print'';$p=~/[@-[]/&&@c||last;chomp($a=<>);$l{$a}|=$p=~s|$a|\l$&|ig||eval shift@c}
|
One of the classics of the contest is to have a program that
prints out The Perl Journal. This entry requires
Perl v6.0 or higher.
(tarball of the submission)
$_='(!|!|!)?\d';s|!|$i++|eg;/$_/;$0='a';$_='19602120n125026117d2';push@ARGV,$&while s;;;;sub t{local$0=$0++;$0++while--$O;$0}$_=join(' ',map join('',map{t ++($O=shift)}2..$i++),++$i..3*2).(s+.+ord$&+ge&&s=\b=${O}b=&&(($O=eval)>>=1)&&t);s,\b.,\u$&,g;print
|