obfuscated
cfreak
Okay so I'm a geek and I spend my Friday night writing a Perl obfu rather than going out. But hey my wife thought it was cool (which probably just means she's a geek too :) ).</p>
<p>This could be more obscure but I think its at least non-obvious the way it is. Will work on a standard size terminal window. *Should* work on Windows but I don't have a box in which to test that theory. Needs <code>Time::HiRes</code>. I did it at first without but it just wasn't as cool. Anyway, here it is:</p>
<code>
#!/usr/bin/perl
use Time::HiRes qw(usleep);
$@='Just Another Perl Hacker';$@=length($@);
$|=abs(2-$@);goto f;z:if(int(rand(10))>5){($-
,$.)=($",$;);}else{($-,$.)=($",$;);}@b =();$b
[0] = $-;if($- ==$;){$b[1]=1;}else{$b[1]=7 +
50 + 10 + (5 * 2);}$,='l';$,='r'if$-==$";$vd
='u';$vd='d'if int(rand(10))<5;while($|){my
$s="";foreach $%(0 .. 22){foreach$=(0 .. 78)
{if($===39){$s.="|";}if($%==$;&& $===0){$s.=
"]";}elsif($===$b[1]&& $%==$b[0]){$s.= "*";}
elsif($===78&& $%==$"){$s.="[\n";}elsif($===
78){$s.=" \n";}else{$s.=" ";}}}print $s;####
$b[1]==1 and$,='r';$b[1]==77 and$,='l';$b[0]
== 23 and$vd='u';$b[0]==0 and$vd='d';if($,eq
'r'){$b[1]++;$mp=\$";}if($, eq'l'){$b[1]--;#
$mp=\$;;}if($vd eq'u'){$b[0]--;$$mp-- unless
$$mp==0;}if($vd eq'd'){$b[0]++;$$mp++ unless
$$mp == 22;}usleep(50_000);system($^);}f:$^=
'clear';$"=int(rand(22));$;=int(rand(22));$^
='cls'if$^O=~m|win|i;goto z;################
</code>
<p>Suggestions welcome!</p>
<p><b>Update:</b> Took out the need for Time::HiRes as suggested by [BrowserUk]</p>
<code>
#!/usr/bin/perl
$@='Just Another Perl Hacker';$@=length($@);
$|=abs(2-$@);goto f;z:if(int(rand(10))>5){($-
,$.)=($",$;);}else{($-,$.)=($",$;);}@b =();$b
[0] = $-;if($- ==$;){$b[1]=1;}else{$b[1]=7 +
50 + 10 + (5 * 2);}$,='l';$,='r'if$-==$";$vd
='u';$vd='d'if int(rand(10))<5;while($|){my
$s="";foreach $%(0 .. 22){foreach$=(0 .. 78)
{if($===39){$s.="|";}if($%==$;&& $===0){$s.=
"]";}elsif($===$b[1]&& $%==$b[0]){$s.= "*";}
elsif($===78&& $%==$"){$s.="[\n";}elsif($===
78){$s.=" \n";}else{$s.=" ";}}}print $s;####
$b[1]==1 and$,='r';$b[1]==77 and$,='l';$b[0]
== 23 and$vd='u';$b[0]==0 and$vd='d';if($,eq
'r'){$b[1]++;$mp=\$";}if($, eq'l'){$b[1]--;#
$mp=\$;;}if($vd eq'u'){$b[0]--;$$mp-- unless
$$mp==0;}if($vd eq'd'){$b[0]++;$$mp++ unless
$$mp == 22;}select $`,$`,$`,.05;system($^);}
f:$^='clear';$"=int(rand(22));$;=int(rand(22
));$^='cls'if$^O=~m|win|i;goto z;###########
</code>
<div class="pmsig"><div class="pmsig-8812">
<a href="http://lobsteraliens.com">Lobster Aliens Are attacking the world!</a>
</div></div>