Cooler ASCII Spinners? [closed]

2019-01-15 23:50发布

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?

18条回答
2楼-- · 2019-01-16 00:18

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)

查看更多
再贱就再见
3楼-- · 2019-01-16 00:21

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.

查看更多
Ridiculous、
4楼-- · 2019-01-16 00:21

I have seen

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

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

查看更多
放荡不羁爱自由
5楼-- · 2019-01-16 00:23

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.

查看更多
混吃等死
6楼-- · 2019-01-16 00:25

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

查看更多
Ridiculous、
7楼-- · 2019-01-16 00:26

Definitely LOLLERSKATES!

    /\O    |    _O    |      O
     /\/   |   //|_   |     /_
    /\     |    |     |     |\
   /  \    |   /|     |    / |
 LOL  LOL  |   LLOL   |  LOLLOL
-----------+----------+-----------
  Frame 0  | Frame 1  |  Frame 2   
查看更多
登录 后发表回答