X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa0ae,85d37e30d034d7ec X-Google-Attributes: gidfa0ae,public X-Google-Thread: fd588,7ad72948312cb279 X-Google-Attributes: gidfd588,public From: abigail@foad.org (Abigail) Subject: Re: Please wait... [was: Perl - Blinking Text] Date: 2000/08/24 Message-ID: #1/1 X-Deja-AN: 662092324 References: <20000815111353.00174.00003174@ng-ch1.aol.com> <967117675.6043@itz.pp.sci.fi> X-Date: MMDL September MCMXCIII X-HTTP: http://purl.oclc.org/NET/Abigail X-Revision: $Revision: 1.2 $ Organization: Abigail's Kinderboerderijen User-Agent: slrn/0.9.6.2 (Linux) Reply-To: abigail@foad.org Newsgroups: comp.lang.perl.misc,alt.ascii-art.animation Greg Bacon (gbacon@HiWAAY.net) wrote on MMDL September MCMXCIII in : @@ @@ How about this? @@ @@ sub bubbles { @@ my @bubble = (' ', '.', 'o', 'O'); @@ my $len = 10; @@ my $tank = join '', @@ map $bubble[rand @bubble], @@ 1 .. $len; @@ @@ my $tmp; @@ while (1) { @@ print "\rPlease wait $tank"; @@ @@ $tank =~ s/(OO+)/$tmp = ' ' x length $1; @@ substr($tmp, rand length $1, 1) = 'O'; @@ $tmp/eg; @@ @@ $tank =~ s/oo/ rand() < 0.5 ? 'O ' : ' O'/eg; @@ $tank =~ s/\.\./ rand() < 0.5 ? 'o ' : ' o'/eg; @@ $tank =~ s/Oo/ rand() < 0.5 ? 'O ' : ' O'/egi; @@ $tank =~ s/\.o|o\./rand() < 0.5 ? 'o ' : ' o'/eg; @@ $tank =~ s/\.O|O\./rand() < 0.5 ? 'oO' : 'Oo'/eg; @@ @@ while (rand() < 0.6) { @@ substr($tank, rand $len, 1) = $bubble[rand @bubble]; @@ } @@ @@ select undef, undef, undef, 0.2; @@ } @@ } That seems to need a $| = 1. Abigail -- perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-