views:

1452

answers:

16

In a console app, an ascii spinner can be used, like the GUI wait cursor, to indicate that work is being done. A common spinner cycles through these 4 characters: '|', '/', '-', '\'

What are some other cyclical animation sequences to spice up a console application?

+3  A: 

Try these

  • '+', 'x'
  • 'v', '<', '^', '>'
Raj More
+30  A: 

Balloons...

. o O @ *
Will Hartung
you get extra points if you can make a popping sound with they system speaker!
RCIX
+2  A: 

In one application, I saw 1,2,3,4,5,6,7,8,9,0.

bryanjonker
+11  A: 

There used to be a a DOS linker named blinker, by Blink Inc. It would display an animation similar to this while it was working:

(o)(o)

(-)(-)

(_)(_)

With the first frame displaying for about a second, and the other two animating briefly once a second or two, making the command line appear to blink its eyes. The effect was pretty cool, actually.

The linker even had options to blink one eye, and you could choose which eye would blink.

Ori Pessach
This looks awesome, took it for my site :)
serg
+5  A: 

I've used a cycle of

Working. 
Working..
Working...

Inspirational I know

PaulG
Simple, yet clean. I've done similar.
Finglas
+45  A: 

Lots of choices with Unicode, including ⌚ and ⌛!

  • ← ↖ ↑ ↗ → ↘ ↓ ↙

  • ▁ ▃ ▄ ▅ ▆ ▇ █ ▇ ▆ ▅ ▄ ▃

  • ▉▊▋▌▍▎▏▎▍▌▋▊▉

  • ▖ ▘ ▝ ▗

  • ┤ ┘ ┴ └ ├ ┌ ┬ ┐

  • ◢ ◣ ◤ ◥

  • ◰ ◳ ◲ ◱

  • ◴ ◷ ◶ ◵

  • ◐ ◓ ◑ ◒

  • ◡◡ ⊙⊙ ◠◠

  • ⣾⣽⣻⢿⡿⣟⣯⣷ ⠁⠂⠄⡀⢀⠠⠐⠈ The entire braille block, even in random order http://www.fileformat.info/info/unicode/block/braille_patterns/images.htm

Joe Koberg
Can you count on your console supporting Unicode?
Ori Pessach
No, but it got the most votes. :-) (Or should I say ☺)
uosɐſ
If you are using a terminal emulator under X or Windows with a decent font, yes.If you are using the hardware (VGA card in text mode), it depends. Linux supports it, depending on the glyphs in the console font. FreeBSD is working on it, presumably with the same font restrictions. Not sure about others.
Joe Koberg
I would not consider this an answer for a question called **Cooler ASCII Spinners?** I mean, it is cool, but...
Andreas Rejbrand
Good point on the stated ASCII requirement. Changing the winner, sorry Joe.
uosɐſ
I understand completely! ☮
Joe Koberg
Using braille glyphs have some raster art potential...
spoulson
This one is so awesome: `◡◡ ⊙⊙ ◠◠`
Harmen
+33  A: 

If you have more than one character worth of space, you can use animated ASCII art. For example, you can do a progress bar like:

[          ]
[==        ]
[=====     ]
[========  ]

or a "bouncing ball" progress indicator (that moves back and forth) like:

(-*--------) // moving -->
(-----*----) // moving -->
(---------*) // moving -->
(--------*-) // moving <--
(---*------) // moving <--
(*---------) // moving <--

Something more advanced like this loading animation might also work.

Edit: There's also the "executive desk toy"

╔════╤╤╤╤════╗    ╔════╤╤╤╤════╗    ╔════╤╤╤╤════╗    ╔════╤╤╤╤════╗
║    │││ \   ║    ║    ││││    ║    ║   / │││    ║    ║    ││││    ║
║    │││  O  ║ -> ║    ││││    ║ -> ║  O  │││    ║ -> ║    ││││    ║
║    OOO     ║    ║    OOOO    ║    ║     OOO    ║    ║    OOOO    ║

And of course there's the ultimate example of animated ASCII art, if you had the time to implement something similar (it would take "spicing up a console application" to the extreme).

Edit: If your console supports color, you can also spice up an otherwise-boring standard spinner by cycling through colors as you spin. Start off with a red line, then slowly fade through the rainbow up to violet as you spin. This can look especially cool with the "bouncing ball" indicator above if you have the ball "paint" the bar a different color on every pass.

bta
+1  A: 

I have seen

 echo -e "\033[41;1m$1 \033[0m"

In bash to continually build a progress bar based on a block character.

ring bearer
+3  A: 

Courtesy of a co-worker of mine, here's a nifty implementation in C:

#define COW 2172
char* moo = "MO ";
void wrap() {
    int i,j;
    for(i=0;doSomething(i);i++)
        j=COW-moo[i&3],fputs(&j,stderr);
}

From my analysis, it only works on a little-endian machine with at least 32-bit words and the ASCII character set. But it's rather diabolically clever.

Daniel Pryden
that is really cool. works on my machine, although I implemented doSomething() to just sleep for 1ms and it animates very slowly... I hope the operation you're doing is quick.
rmeador
For the lazy: So what's the effect, then?
uosɐſ
@Jason: Nothing terribly fancy. But where's the fun in just telling you what it looks like? :-)
Daniel Pryden
Didn't compile for me on VS2010 without a cast: `fputs((const char*)` ... and it was a bit of a disappointment when it did.
Evgeny
@Evgeny: Yeah, the original was in C; if you use a C++ compiler you'll need a cast. And I never said it was an exciting display, just that the implementation was rather nifty.
Daniel Pryden
+2  A: 

Makes a cute "rain" effect:

using System;
using System.Text;
using System.Threading;

namespace CSharpSandbox
{
    class Program
    {
        static Random rnd = new Random();
        static char[,] Step(char[,] matrix)
        {
            int width = matrix.GetUpperBound(0) + 1;
            int height = matrix.GetUpperBound(1) + 1;

            char[,] res = new char[width, height];
            for (int h = 0; h < height; h++)
            {
                for (int w = 0; w < width; w++)
                {
                    char c;
                    if (h == 0)
                        c = rnd.Next(2) == 0 ? ' ' : '*';
                    else
                        c = matrix[w, h - 1];

                    res[w, h] = c;
                }
            }

            return res;
        }

        static string ToString(char[,] matrix)
        {
            int width = matrix.GetUpperBound(0) + 1;
            int height = matrix.GetUpperBound(1) + 1;
            StringBuilder sb = new StringBuilder();

            for (int h = 0; h < height; h++)
            {
                for (int w = 0; w < width; w++)
                {
                    sb.Append(matrix[w, h]);
                }
                sb.AppendLine();
            }
            return sb.ToString();
        }

        static Timer timer;
        static void Spinner()
        {
            char[,] matrix = new char[10, 5];
            timer = new Timer(_ =>
                {
                    string s = ToString(matrix);

                    Console.SetCursorPosition(0, 0);
                    Console.Write(s);

                    matrix = Step(matrix);
                },
                null,
                0,
                200);
        }

        static void Main(string[] args)
        {
            Spinner();
            Console.ReadLine();
        }
    }
}
Juliet
Very nice! It looks great with `char[,] matrix = new char[Console.WindowWidth-1, Console.WindowHeight-1];` in `Spinner()`
Callum Rogers
Change `*` with `,` for a blizzard.
Sorin Comanescu
+1  A: 

I wrote one that cycled through the standard \ | / - but the left a _ and moved on to the next position. It was intended to look as though there were a series of spinners, each dropping to the floor before the next one started. The need for this was that my program was repeatedly trying something and waiting for a certain result. I wanted to represent each time it tried and also how many times it had tried without using up a lot of screen space (or count).

After I wrote it it looked a lot less cool than I thought it would, but it served its purpose.

nategoose
+21  A: 

Definetely LOLLERSKATES!

    /\O    |    _O    |      O
     /\/   |   //|_   |     /_
    /\     |    |     |     |\
   /  \    |   /|     |    / |
 LOL  LOL  |   LLOL   |  LOLLOL
-----------+----------+-----------
  Frame 0  | Frame 1  |  Frame 2   
Harmen
This made me ROFLCOPTER.
Auguste
The "OMGWTFBBQ!!!1" is a little to big for this: http://www.kreativekorp.com/miscpages/omgwtfbbq/omgwtfbbq.gif , so is its extended version: http://i234.photobucket.com/albums/ee298/davidshek/omgwtfbbq.gif
Harmen
This one made my chuckle!
Shervin
Hah, excellent!
Sorin Comanescu
+3  A: 

fish is a Python module that animates an ASCII fish going back and forth, and who doesn't like the rare console fish?

>))'>
    >))'>
        >))'>
    <'((<
<'((<
Daniel DiPaolo
That's a great one!
Harmen
A: 
   __o
 _`\<._
(_)/ (_)

    __o
  _`\<._
 (_)/ (_)

     __o
   _`\<._
  (_)/ (_)

    ...

    o__
   _.>/ _
  (_) \(_)

   o__
  _.>/ _
 (_) \(_)

  o__
 _.>/ _
(_) \(_)
Ehsan
+2  A: 

If you know how far through the process you are I like the percentage bar. It looks nice, feels intuitive and is easy to implement:

| 0%

||||| 5%

|||||||||||||||||||||| 26%

||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 100%

(Examples above are not exact)

Tom Gullen
+1  A: 

All taken from:

http://llizard.cwahi.net/animals.html

Bats Flying!

                   /^v^\
         /^v^\                      /^v^\
                /^v^\

  /^v^\

Flap flap!

                   \^v^/
         \^v^/                      \^v^/
                \^v^/

  \^v^/

Wow wow An Archer!

       /\
      /__\_{)
     |--<<)__\
      \  /  (
       \/   )
           /|
           \ \
           ~ ~

         /|   \
        /_|_{)/
---<<   | |  )
        \ |  (
         \|  )
            /|
            \ \
            ~ ~
             \
         /|{)/
---<<   +-|-)
         \| (
            )
           /|
           \ \
           ~ ~

       /\
      /__\_{)
     |--<<)__\
      \  /  (
       \/ __)
           \ |__
          ~    ~

         /|   \
        /_|_{)/
---<<   | |  )
        \ |  (
         \|__)
           \ |__
           ~    ~


             \
         /|{)/
---<<   +-|-)
         \| (
          __)
           \ |__
          ~    ~

Super Cyclist

                        ---------- __o
                       --------  _ \<,_
                     -------    (*)/ (*)

Wheeeee!

Flying a Kite

                                                /\
                                               '\/
                                              '  +
                                             '     +
                                           '      +
                                         '         +
                                       '             +
                                     '                  +
                                   '
                                 '
                               '
                             '
                           '
                        '
                    '
                '
__          '
\o  .   '
 \\/
 /\
/ /

This fishing one is pretty hillarious as well

http://asciimator.net/kangaroo/fishing.html

Tom Gullen