perl -e 'my $ani=1;if($#ARGV>=0&&$ARGV[0]eq"noani"){$ani=0}use Term::ReadKey;my($xm,$ym)=GetTerminalSize;print "\e[?25l";ReadMode(2);ReadMode(4);use worm;sub b{init_worm("+");set_worm_delay(0.001);clrscr;my($x,$y)=(1,1);foreach my$i(1..$xm){creep_worm($i,1)}foreach my$i(1..$ym){creep_worm($xm,$i)}for(my$i=$xm;$i!=$1;$i--){creep_worm($i,$ym)}for(my$i=$ym;$i!=1;$i--){creep_worm(1,$i)}}if($ani){b();init_worm("::[ j :: left  ]::::] thgir :: l [::::[ i :: top   ]::::]  nwod :: k [::::[ x :: exit  ]::                  .:[ press enter]:. ");foreach(my $y=$ym-1;$y>=int($ym*2/3);$y-=2){for(my $x=int($xm/2)-9;$x!=int($xm/2)+9;$x++){creep_worm($x,$y)}for(my $x=int($xm/2)+8;$x!=int($xm/2)-10;$x--){creep_worm($x,$y-1)}};init_worm("::] ed.ccc.revonnah\@rgm / ten.xmg\@ffalzter.m [::.:[ tiny gpl\47d nibble clone written in perl  ]:. ");my $y=int($ym/3);for(my $x=$xm-1;$x!=int($xm/2)-24;$x--){creep_worm($x,$y)}$y++;for(my $x=int($xm/2)-23;$x!=int($xm/2)+25;$x++){creep_worm($x,$y)}init_worm("");init_worm("\@.OOOOOOooooooo...... ");for(my $x=int($xm/5),my $y=$ym-1;$y>=int($ym/2);$y--){creep_worm($x,$y)}for(my $y=int($ym/2),my $x=int($xm/5);$x!=int($xm/2)+11;$x++){creep_worm($x,$y)}}my($x,$y,$k)=(2,2,"l");gotoxy($x,$y);if($ani){<STDIN>}clrscr;b();init_worm("\@.OOOOOOooooooo...... ");set_worm_delay(0.07) ;my @scr=();foreach(1..int($xm*$ym*5/1000)){my($x,$y)=(int(rand($xm-2)+2),int(rand($ym-2)+2));$scr[$y]->[$x]=1;gotoxy($x,$y);print"x"}while($k ne"x"){my $kt=ReadKey(-1);if(defined($kt)&&$kt=~/[jklix]/){$k=$kt}if($k eq"j"&&$x>0){$x--}elsif($k eq"l"&&$x<$xm){$x++}elsif($k eq"i"&&$y>0){$y--}elsif($k eq"k"&&$y<$ym){$y++}if($k ne"x"){creep_worm($x,$y)}if($x==1||$y==1||$x==$xm||$y==$ym){my $px=int($xm/2)-7;my $py=int($ym/2);print "\e[".$py.";".$px."H ::[ luser ]:: ";$k="x"}if(defined($scr[$y]->[$x])){grow_worm(undef,".","o")}}gotoxy(1,$ym-1);print "\e[J";ReadMode(0);ReadMode(1);print "\e[?25h"'
