Settings

The page will reload to apply your changes.
Theme

ASCII Art Font

ASCII Art Menu

Original Usenet thread from alt.ascii-art.animation, started 24 Aug 2000.
 _   _                     _        _             _     _           
| | | |___  ___ _ __   ___| |_     / \   _ __ ___| |__ (_)_   _____ 
| | | / __|/ _ \ '_ \ / _ \ __|   / _ \ | '__/ __| '_ \| \ \ / / _ \
| |_| \__ \  __/ | | |  __/ |_   / ___ \| | | (__| | | | |\ V /  __/
 \___/|___/\___|_| |_|\___|\__| /_/   \_\_|  \___|_| |_|_| \_/ \___|
Please wait... [was: Perl - Blinking Text]

Please wait... [was: Perl - Blinking Text]

alt.ascii-art.animation · 7 messages · 24 Aug 2000 - 25 Aug 2000
Ilmari Karonen <ilt...@sci.invalid> ASCII art 24 Aug 2000 00:00 · permalink · report
In article <spi...@corp.supernews.com>, Greg Bacon wrote:
>In article <200...@ng-ch1.aol.com>,
>    Louis <lou...@aol.com> wrote:
>: Hi.  While my perl script is processing, I would like the print line
>: "Please wait, processing data .. " to blink at the command line
>: (UNIX).  Does anyone know how I can get the text to blink?
>
>Yuck.  Just say no.  How about a spinner?

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.

  perl -e '$|=1; print "\rPlease wait", grep tr/01/ ./ => unpack "b*"
	   => pack "v" => $i while ++$i and sleep 1'

  perl -e '$|=1; print "\rPlease wait", grep tr/01/ ./ => unpack "b*"
	   => pack "v" => $i^$i/2 while ++$i and sleep 1'

Here are two I came up with right now - I can't decide which one I
like more.  All it takes is a bit of creativity.

[Crossposted from comp.lang.perl.misc to alt.ascii-art.animation.]

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla  | "By promoting postconditions to
and its pseudonyms -    |  preconditions, algorithms become
do not feed the troll.  |  remarkably simple."  -- Abigail

I was shocked! How could Ilmari Karonen <ilt...@sci.invalid>
say such a terrible thing:

>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.
>
>  perl -e '$|=1; print "\rPlease wait", grep tr/01/ ./ => unpack "b*"
>	   => pack "v" => $i while ++$i and sleep 1'
>
>  perl -e '$|=1; print "\rPlease wait", grep tr/01/ ./ => unpack "b*"
>	   => pack "v" => $i^$i/2 while ++$i and sleep 1'

rand $i makes a nice effect too :)

-- 
Gwyn Judd (print `echo 'tjl...@guvfybir.qlaqaf.bet' | rot13`)
Boob's Law:
	You always find something in the last place you look.

Greg Bacon <gba...@HiWAAY.net> ASCII art 24 Aug 2000 00:00 · permalink · report
In article <967...@itz.pp.sci.fi>,
    Ilmari Karonen  <use...@itz.pp.sci.fi> 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

Abigail <abi...@foad.org> ASCII art 24 Aug 2000 00:00 · permalink · report
Greg Bacon (gba...@HiWAAY.net) wrote on MMDL September MCMXCIII in
<URL:news:sqa...@corp.supernews.com>:
@@ 
@@ 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+]}-

Ilmari Karonen <ilt...@sci.invalid> ASCII art 24 Aug 2000 00:00 · permalink · report
In article <slr...@thislove.dyndns.org>, Gwyn Judd wrote:
>I was shocked! How could Ilmari Karonen <ilt...@sci.invalid>
>say such a terrible thing:
>>
>>  perl -e '$|=1; print "\rPlease wait", grep tr/01/ ./ => unpack "b*"
>>	   => pack "v" => $i while ++$i and sleep 1'
>>
>>  perl -e '$|=1; print "\rPlease wait", grep tr/01/ ./ => unpack "b*"
>>	   => pack "v" => $i^$i/2 while ++$i and sleep 1'
>
>rand $i makes a nice effect too :)

A bit too, well, random for my taste.  $i^$i/4 looks somewhat less
repetitive than the above two, yet sufficiently ordered that one could
probably stare at it quite some time trying to figure out the pattern.

Another somewhat simpler looking animation I came up with is:

  perl -e '$i=$|=1; print "\rPlease wait", grep tr/01/ ./ =>
           unpack "b*" => pack "V" => $i^=$i<<1 while sleep 1'

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
"True, but the user receiving the e-mailed password might think
 'Strange, I don't remember choosing "&\xe7?\x9b\x3f\t\xef\xb7"
 as my password, and how do I type it?'"  -- Keith C. Ivey

David Riley <dav...@dmriley.demon.co.uk> ASCII art 25 Aug 2000 00:00 · permalink · report
Ilmari Karonen <ilt...@sci.invalid> writes:

> Another somewhat simpler looking animation I came up with is:
> 
>   perl -e '$i=$|=1; print "\rPlease wait", grep tr/01/ ./ =>
>            unpack "b*" => pack "V" => $i^=$i<<1 while sleep 1'

I like this one best so far. It also looks good using Abigail's
prime number regexp:

perl -e '$i=$|=1; while ($i++) {print "\rPlease wait", grep tr/01/ ./ =>
unpack "b*" => pack "V" => $i if (1 x $i) !~ /^(11+)\1+$/ and sleep 1;'}

-- 
David Riley 		dav...@dmriley.demon.co.uk

In article <slr...@alexandra.foad.org>,
    Abigail <abi...@foad.org> wrote:

: Greg Bacon (gba...@HiWAAY.net) wrote on MMDL September MCMXCIII in
: <URL:news:sqa...@corp.supernews.com>:
:
: @@ How about this?
: @@ 
: @@     sub bubbles {
: @@         [...]
: @@     }
: 
: That seems to need a $| = 1.

Yeah, and a call to bubbles() while we're at it.  I thought they were
understood. :-)

Greg
-- 
People should think first, then wave with awards.
    -- Abigail

About this thread. These messages were posted publicly to the newsgroup alt.ascii-art.animation in 2000 and are mirrored here unchanged as part of the Historic Archives – only email addresses are masked. The artwork and text belong to their original authors: if you copy a piece, keep the artist's initials or signature intact and credit them where you can. Are you one of the authors? Contact us to get your posts attributed, connected to your artist profile, or removed.

Report this message

Help us keep the archive clean and accurate. Reports are reviewed by a person – nothing is changed automatically.

Help classify this post