[FLUG] matrix.pl

  • From: apt Gecco <gecco@xxxxxxxxxxxx>
  • To: fanolug@xxxxxxxxxxxxx
  • Date: Thu, 21 Feb 2002 23:59:30 +0100

Mailing List del Fortunae LUG
=============================

stasera coi miei amici ho visto matrix su dvd, e in proposito ho questo
codice in perl

#!/usr/bin/perl

use strict;

my (@A) = (' ','  ','  ','  ',' ','  ','  ','  
','.','o','O','0','*','@');
my ($B,$C,$D,$E) = (60,9,0,'');
my (@F);
my ($G,$H) = ('',300); # $H controls animation duration: 100 is about
3.5 seconds

while($H) {
        for($D=0;$D<$C;$D++) {

                if($H - ($B+5) > 0) {

                        $E = int(rand($#A));
                        $F[$D] = $A[$E] . $F[$D];
                        $F[$D] = substr($F[$D],0,$B);

                } else {

                        $F[$D] = ' ' . $F[$D];
                        $F[$D] = substr($F[$D],0,$B);
                }

        }
                
        foreach $G (@F) {
                print $G . "\n";
        }

        system(clear);

        $H--;
}


bau
-- 
Machine gave me some freedom.
--
apt-get... un presidente operaio...

Other related posts: