X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fd588,7ad72948312cb279 X-Google-Attributes: gidfd588,public X-Google-Thread: fa0ae,85d37e30d034d7ec X-Google-Attributes: gidfa0ae,public From: gbacon@HiWAAY.net (Greg Bacon) Subject: Re: Please wait... [was: Perl - Blinking Text] Date: 2000/08/24 Message-ID: #1/1 X-Deja-AN: 661976215 References: <20000815111353.00174.00003174@ng-ch1.aol.com> <967117675.6043@itz.pp.sci.fi> X-Complaints-To: newsabuse@supernews.com X-Eric-Conspiracy: There is no conspiracy. Organization: Eric Conspiracy Secret Labs Reply-To: Greg Bacon Newsgroups: comp.lang.perl.misc,alt.ascii-art.animation Originator: gbacon@HiWAAY.net (Greg Bacon) In article <967117675.6043@itz.pp.sci.fi>, Ilmari Karonen wrote: : Twirling batons are rather cliche, though. If you're going to have : your users staring at a "please wait" message, the least you could do : is make it a little bit interesting. 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; } } Greg -- Windows was created to keep the stoopid people away from Unix, you know. An "MS advocate" is already beneath contempt. -- Tom Christiansen