#!/usr/bin/perl -w
#
# foo2.pl
# 
# WARNING: THIS IS A DANGEROUS WORM! TAKE PRECAUTIONS!
#
# author: Max-Gerd Retzlaff <m.retzlaff@gmx.net>
#                           <mgr@hannover.ccc.de>
#
# date:    Mon Jun 17 00:46:52 CEST 2002
#
# GnuPG-Information:
#  Fingerprint: 49CD 21F2 41AC 72C5 D0D1  27DC C2B2 48AE 8123 9F12
#  pub  1024D/81239F12 2002-03-12 Max-Gerd Retzlaff <m.retzlaff@gmx.net>
#  uid                            Max-Gerd Retzlaff <mgr@hannover.ccc.de>
#  sub  4096g/63E36E39 2002-03-12
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version. 
#
# This application is distributed in the hope that it will be useful, 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111 USA.  

#clear; echo -e "\e[130;0H";while (true); do for i in $(seq 40);do echo -e "\e[${i};${i}H ::[ PLIK ]:: ";let x=40-$i;echo -e "\e[${i};${x}H ::[ PLOK ]:: ";sleep 0.05;echo -e "\e[${x};20H ::[ PLÖK ]:: ";done;done

clrscr();
$width=40;
while(1) {
    foreach $x (1..$width+15) {
	foreach $o ($x-5..$x) {
	    if ( $o > 0 && $o < $width ) {
		gotoxy($o,$o);
		print "O";
	    }
	}
	foreach $o ($x-10..$x-5) {
	    if ( $o > 0 && $o < $width ) {
		gotoxy($o,$o);
		print "o";
	    }
	}
	foreach $o ($x-15..$x-10) {
	    if ( $o > 0 && $o < $width ) {
		gotoxy($o,$o);
		print ".";
	    }
	}
	foreach $o ($x-20..$x-15) {
	    if ( $o > 0 && $o < $width ) {
		gotoxy($o,$o);
		print " ";
	    }
	}
	select(STDOUT);$|=1;
	select(undef,undef,undef,0.1);
    }
    foreach $x (1..$width+20) {
	$x=$width-$x;
	foreach $o ($x..$x+5) {
	    if ( $o > 0 && $o < $width ) {
		gotoxy($o,$o);
		print "O";
	    }
	}
	foreach $o ($x+5..$x+10) {
	    if ( $o > 0 && $o < $width ) {
		gotoxy($o,$o);
		print "o";
	    }
	}
	foreach $o ($x+10..$x+15) {
	    if ( $o > 0 && $o < $width ) {
		gotoxy($o,$o);
		print ".";
	    }
	}
	foreach $o ($x+15..$x+20) {
	    if ( $o > 0 && $o < $width ) {
		gotoxy($o,$o);
		print " ";
	    }
	}
	select(STDOUT);$|=1;
	select(undef,undef,undef,0.1);
    }
    clrscr();
}
	
sub clrscr {
    print "\e[H\e[J";
}
sub home {
    print "\e[H";
}
sub gotoxy { 
    print "\e[".$_[1].";".$_[0]."H";
}
