Cooler ASCII Spinners? [closed]
Asked Answered
Q

18

317

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?

Quinquereme answered 21/4, 2010 at 18:10 Comment(9)
seems like a perfectly valid question to me.Jaela
I'm interested because I want to use one in a real project!Quinquereme
Closing this question seems quite unwarranted. While console text mode UIs are less fashionalbe than GUI's, they are still on topic. Furthermore, the question has been upvoted and has garnered serveral useful answers (also upvoted).Incretion
Why should it be community wiki, and how is it off topic? It's totally a programming related question? Would it be better on SuperUser? No. ServerFault? No.Tricksy
@roe: community wiki means the OP wants his question and answers to be editable by anyone on the site -- which may not be the OPs intention. Wiki is not used to classify questions as "subjective" or "no single answer", that's what tags are for. @Jason: you don't need to wiki this question if you don't want to.Cragsman
Thanks for the support all. I marked an answer because I thought it was over, but obviously it is subjective, so keep contributing! Thanks!Quinquereme
The question is certainly subjective, but seems to be answerable modulo the question of what constitutes "cool". Should remain open.Bulgaria
@Juliet: Once again, the formal meaning of CW has---for most of the site's history---been supplemented with a community norm that "fun", non-technical, and poll-like content should be made CW and may be closed if there are not. Blithely ignoring this fact does not make it go away, nor does endlessly repeating your mantra that CW isn't needed on soft content. This question is balanced every so delicately on the cusp, but I'm for giving it a pass.Bulgaria
This question gives me hope in humanityPlastic
S
90

Balloons...

. o O @ *
Sandeesandeep answered 21/4, 2010 at 18:23 Comment(2)
@RCIX I just did that with the '\a' character :)Ruben
I call it "cells" o 0 8 oo 00 88 ...Plexor
S
245

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

Serene answered 21/4, 2010 at 19:8 Comment(9)
Can you count on your console supporting Unicode?Cowbane
No, but it got the most votes. :-) (Or should I say ☺)Quinquereme
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.Serene
I would not consider this an answer for a question called Cooler ASCII Spinners? I mean, it is cool, but...Antepast
Good point on the stated ASCII requirement. Changing the winner, sorry Joe.Quinquereme
Using braille glyphs have some raster art potential...Advocaat
One of those unproductive nights... spinnerFrames=['▁','▃','▄','▅','▆','▇','█','▇','▆','▅','▄','▃']; currFrame=0; function nextFrame(){ $('#question-header a').html(spinnerFrames[currFrame]); currFrame=(currFrame==spinnerFrames.length-1)? 0:currFrame+1; } setInterval(nextFrame, 100);Porphyroid
Using braille code you can do some sweet things: ⢎⡰⢎⡡⢎⡑⢎⠱⠎⡱⢊⡱⢌⡱⢆⡱, see an example hereEyetooth
braille progress bar: ⣀⣠⣤⣴⣶⣾⣿Resin
D
138

Watch them in action here:

var nl = "\r\n";
var spinners = [
  "←↖↑↗→↘↓↙",
  "▁▃▄▅▆▇█▇▆▅▄▃",
  "▉▊▋▌▍▎▏▎▍▌▋▊▉",
  "▖▘▝▗",
  "▌▀▐▄",
  "┤┘┴└├┌┬┐",
  "◢◣◤◥",
  "◰◳◲◱",
  "◴◷◶◵",
  "◐◓◑◒",
  "|/-\\",
  ".oO@*", ["◡◡", "⊙⊙", "◠◠"],
  ["◜ ", " ◝", " ◞", "◟ "],
  "◇◈◆",
  "⣾⣽⣻⢿⡿⣟⣯⣷",
  "⡀⡁⡂⡃⡄⡅⡆⡇⡈⡉⡊⡋⡌⡍⡎⡏⡐⡑⡒⡓⡔⡕⡖⡗⡘⡙⡚⡛⡜⡝⡞⡟⡠⡡⡢⡣⡤⡥⡦⡧⡨⡩⡪⡫⡬⡭⡮⡯⡰⡱⡲⡳⡴⡵⡶⡷⡸⡹⡺⡻⡼⡽⡾⡿⢀⢁⢂⢃⢄⢅⢆⢇⢈⢉⢊⢋⢌⢍⢎⢏⢐⢑⢒⢓⢔⢕⢖⢗⢘⢙⢚⢛⢜⢝⢞⢟⢠⢡⢢⢣⢤⢥⢦⢧⢨⢩⢪⢫⢬⢭⢮⢯⢰⢱⢲⢳⢴⢵⢶⢷⢸⢹⢺⢻⢼⢽⢾⢿⣀⣁⣂⣃⣄⣅⣆⣇⣈⣉⣊⣋⣌⣍⣎⣏⣐⣑⣒⣓⣔⣕⣖⣗⣘⣙⣚⣛⣜⣝⣞⣟⣠⣡⣢⣣⣤⣥⣦⣧⣨⣩⣪⣫⣬⣭⣮⣯⣰⣱⣲⣳⣴⣵⣶⣷⣸⣹⣺⣻⣼⣽⣾⣿",
  "⠁⠂⠄⡀⢀⠠⠐⠈", [">))'>", " >))'>", "  >))'>", "   >))'>", "    >))'>", "   <'((<", "  <'((<", " <'((<"],
  ["    /\\O\n     /\\/\n    /\\\n   /  \\\n LOL  LOL", "     _O\n   //|_\n    |\n   /|\n   LLOL", "      O\n     /_\n     |\\\n    / |\n  LOLLOL"],
  [
    "╔════╤╤╤╤════╗\n║    │││ \\   ║\n║    │││  O  ║\n║    OOO     ║",
    "╔════╤╤╤╤════╗\n║    ││││    ║\n║    ││││    ║\n║    OOOO    ║",
    "╔════╤╤╤╤════╗\n║   / │││    ║\n║  O  │││    ║\n║     OOO    ║",
    "╔════╤╤╤╤════╗\n║    ││││    ║\n║    ││││    ║\n║    OOOO    ║"
  ],
  [
" "+nl+
" "+nl+
" "+nl+
" "+nl+
"           '\\"+nl+
"          '  \\===%^,"+nl+
"        '     \\@   >"+nl+
"      '        `\\/>     _"+nl+
"    '       ______>,^____\\"+nl+
"  '         \\-=-=-=-=-=-/{}"+nl+
"'~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"           '\\"+nl+
"          '  \\===%^,"+nl+
"        '     \\@   >"+nl+
"      '        `\\/>     _"+nl+
"    '       ______>,^____\\"+nl+
"  '         \\-=-=-=-=-=-/{}"+nl+
"'-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"           '\\"+nl+
"          '  \\===%^,"+nl+
"        '     \\@   >"+nl+
"      '        `\\/>     _"+nl+
"    '       ______>,^____\\"+nl+
"  '         \\-=-=-=-=-=-/{}"+nl+
"'~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"           '\\"+nl+
"          '  \\===%^,"+nl+
"        '     \\@   >"+nl+
"      '        `\\/>     _"+nl+
"    '       ______>,^____\\"+nl+
"  '         \\-=-=-=-=-=-/{}"+nl+
"'-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"           '\\"+nl+
"          '  \\===%^,"+nl+
"        '     \\@   >"+nl+
"      '        `\\/>     _"+nl+
"    '       ______>,^____\\"+nl+
"  '         \\-=-=-=-=-=-/{}"+nl+
"'~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"           '\\"+nl+
"          '  \\ ==%^,"+nl+
"        '     \\@   >"+nl+
"      '        `\\/>     _"+nl+
"    '       ______>,^____\\"+nl+
"  '         \\-=-=-=-=-=-/{}"+nl+
"'-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"           '\\"+nl+
"          '  \\  =%^,"+nl+
"        '     \\@   >"+nl+
"      '        `\\/>     _"+nl+
"    '       ______>,^____\\"+nl+
"  '         \\-=-=-=-=-=-/{}"+nl+
"'~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"           '\\"+nl+
"          '  \\   %^,"+nl+
"        '     \\@   >"+nl+
"      '        `\\/>     _"+nl+
"    '       ______>,^____\\"+nl+
"  '         \\-=-=-=-=-=-/{}"+nl+
"'-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"           '\\"+nl+
"          '  \\    ,^%"+nl+
"        '     \\@  <"+nl+
"      '        `\\/>     _"+nl+
"    '       ______>,^____\\"+nl+
"  '         \\-=-=-=-=-=-/{}"+nl+
"'~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"           '\\"+nl+
"          '  \\    ,^%="+nl+
"        '     \\@  <"+nl+
"      '        `\\/>     _"+nl+
"    '       ______>,^____\\"+nl+
"  '         \\-=-=-=-=-=-/{}"+nl+
"'-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"           '\\"+nl+
"          '  \\    ,^%=="+nl+
"        '     \\@  <"+nl+
"      '        `\\/>     _"+nl+
"    '       ______>,^____\\"+nl+
"  '         \\-=-=-=-=-=-/{}"+nl+
"'~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"           '\\"+nl+
"          '  \\    ,^%==="+nl+
"        '     \\@  <"+nl+
"      '        `\\/>     _"+nl+
"    '       ______>,^____\\"+nl+
"  '         \\-=-=-=-=-=-/{}"+nl+
"'-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"           '\\"+nl+
"         '   \\    ,^%==="+nl+
"       '      \\@  <"+nl+
"     '         `\\/>     _"+nl+
"   '        ______>,^____\\"+nl+
" '          \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"           '\\"+nl+
"        '    \\    ,^%==="+nl+
"     '        \\@  <"+nl+
"  '            `\\/>     _"+nl+
"            ______>,^____\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"           '\\"+nl+
"        '    \\    ,^%==="+nl+
"     '        \\@  <"+nl+
"  '            `\\/>     _"+nl+
"            ______>,^____\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"             '|"+nl+
"         '    |   ,^%---"+nl+
"     '        |@  <  \\"+nl+
"  '            `\\/>     _"+nl+
"            ______>,^____\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"               '/"+nl+
"          '    /  ,^%---"+nl+
"      '       /@  <  \\"+nl+
"  '            `\\/>     _"+nl+
"            ______>,^____\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"             '|"+nl+
"         '    |   ,^%---"+nl+
"     '        |@  <  \\"+nl+
"  '            `\\/>     _"+nl+
"            ______>,^____\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"               '/"+nl+
"          '    /  ,^%---"+nl+
"      '       /@  <  \\"+nl+
"  '            `\\/>     _"+nl+
"            ______>,^____\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                '/"+nl+
"           '    /   ,^%---"+nl+
"      '        /@  <   \\"+nl+
"  '             `\\/>    _"+nl+
"            ______>,^____\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                 '|"+nl+
"           '     /   ,^%---"+nl+
"      '         /@  <   \\"+nl+
"  '              `\\/>   _"+nl+
"            _______>,^___\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                 '\\"+nl+
"           '      |   ,^%---"+nl+
"      '          /@  <   \\"+nl+
"  '               `\\/>  _"+nl+
"            ________>,^__\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                 '|"+nl+
"           '     /   ,^%---"+nl+
"      '         /@  <   \\"+nl+
"  '              `\\/>   _"+nl+
"            _______>,^___\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                 '\\"+nl+
"           '      |   ,^%---"+nl+
"      '          /@  <   \\"+nl+
"  '               `\\/>  _"+nl+
"            ________>,^__\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"'                 '/"+nl+
"  '        '      / \\_,^%---"+nl+
"    ' '          /@  <   \\"+nl+
"                  `\\/>  _"+nl+
"            ________>,^__\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
";''"+nl+
"   '              '/ /"+nl+
"    '        '    /  \\,^%==="+nl+
"      '  '       /@  <"+nl+
"                  `\\/>  _"+nl+
"            ________>,^__\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
"   ;''"+nl+
"      '           '/ /"+nl+
"     '       '    /  \\,^%==="+nl+
"       ' '       /@  <"+nl+
"                  `\\/>  _"+nl+
"            ________>,^__\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
"     ;''"+nl+
"        '"+nl+
"       '          '/ /"+nl+
"         '   '    /  \\,^%==="+nl+
"                 /@  <"+nl+
"                  `\\/>  _"+nl+
"            ________>,^__\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
"       ;'"+nl+
"         '"+nl+
"       '          '/ /"+nl+
"        '   '     /  \\,^%=="+nl+
"                 /@  <"+nl+
"                  `\\/>  _"+nl+
"            ________>,^__\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
"            ; "+nl+
"          '"+nl+
"        '         '/ /"+nl+
"         '   '    /  \\,^%="+nl+
"                 /@  <"+nl+
"                  `\\/>  _"+nl+
"            ________>,^__\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
"'.      ;'."+nl+
"  '-     .'       '/ _"+nl+
"*) /    '     '   /  \\=%"+nl+
"  _\\     ' '     /@    >"+nl+
"'~                `\\/>  _"+nl+
"            ________>,^__\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
"`-."+nl+
"   '.        ;"+nl+
"     '-    .  '   '/_"+nl+
"{ (*) /   '   '   / \\==@^"+nl+
"     _\\   ' '    /@    >"+nl+
".;;'~             `\\/>  _"+nl+
"            ________>,^__\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
"  \\\\\\\\"+nl+
".-'   `-.   ;"+nl+
"         '.'"+nl+
"           '-   '|"+nl+
"     {{ (*) / '' |===@^"+nl+
"           _\\    |@   >"+nl+
"      .;;'~       `\\/>  _"+nl+
"/~~''~      ________>,^__\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
"        \\\\\\\\      ;"+nl+
"      .-'   `-.  '"+nl+
"   .-'         '. ''"+nl+
" .'              '-      \\"+nl+
"'          {{ (*) /===@^,/"+nl+
"-.               _\\    >"+nl+
"  ~-.       .;;'~|@ \\/> _"+nl+
"    ///~~''~______`__>,^_\\"+nl+
"            \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
"             \\\\\\\\ "+nl+
"           .-'   `-."+nl+
"        .-'         '."+nl+
"      .'              '-        \\"+nl+
"(`-.-'          {{ (*) /  ===@^,/"+nl+
" } .'~-.              _\\/     >"+nl+
" (/     ~-.      .;;'~ /   \\/> "+nl+
"          ///~''~_____/@____>,^"+nl+
"                 \\-=-=-`-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
"             \\\\\\\\      YIKES"+nl+
"           .-'   `-."+nl+
"        .-'         '.          /"+nl+
"      .'              '- ---@^,/"+nl+
" (`-.-'          {{ (*) /  /  >"+nl+
"  } .'~-.              _\\   \\/> "+nl+
"  (/     ~-.      .;;'~_____>,^"+nl+
"           ///~''~-=-=|@-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
"                       YIKES"+nl+
"              \\\\\\\\"+nl+
"            .-'   `-.          \\"+nl+
"         .-'         '.  ---@^,/"+nl+
"       .'              '-  /  >"+nl+
" (`-.-'          {{ (*) /   \\/> "+nl+
"  } .'~-.              _\\___>,^"+nl+
"  (/     ~-.      .;;'~/=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~/@-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",


" "+nl+
" "+nl+
"                       YIKES"+nl+
" "+nl+
"              \\\\\\\\             _"+nl+
"            .-'   `-.    ---@^,/"+nl+
"         .-'         '.    /  >"+nl+
"       .'              '-   \\/> "+nl+
" (`-.-' .  .  `  {{ (*) /___>,^"+nl+
"  } .'~-.    .  `      _\\-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-/-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
"                       YIKES"+nl+
" "+nl+
"                               _"+nl+
"  ` .         \\\\\\\\       ---@^,/"+nl+
"      `  `  .-'   `-.  .  '/  >"+nl+
"       ` .-'         '.  '  \\/> "+nl+
"       `'  `           '-___>,^"+nl+
" (`-.-' .  .  `  {{ (*) /-=-=-/{}"+nl+
"-~-~-~-~-~-~-`-.  . ` ' \\~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
"                       YIKES"+nl+
" "+nl+
"                               _"+nl+
"  ` .                 '  ---=^,/"+nl+
"      `  `         .   .   /  >"+nl+
"   `   `      \\\\\\\\   '      \\/> "+nl+
"      `  `  .-'   `-. ______>,^"+nl+
"       ` .-'         '.-=-=-=-/{}"+nl+
"~-~-~-~-~-.-~-~-~-'-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
"                       YIKES"+nl+
" "+nl+
"` .                     '      _"+nl+
"     `  `                ---@^,/"+nl+
"   `   `             '     /  >"+nl+
"     `  `                   \\/> "+nl+
"      `     `      __________>,^"+nl+
"             ` \\\\\\\\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~'    `-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
"                         ."+nl+
"                       '       _"+nl+
"  ` .                    ---@^,/"+nl+
"      `  `                 /  >"+nl+
"   `   `     .              \\/> "+nl+
"      `  `     .   __________>,^"+nl+
"       `     `   ` \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~\\\\\\\\.~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"  `   .                        _"+nl+
"   ``                '   ===-^,/"+nl+
" `      `                     >"+nl+
"     `             '        \\/> "+nl+
"         `      .  __________>,^"+nl+
"              `    \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-`-.-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
" .   `                    '    _"+nl+
"   `      `              ===-^,/"+nl+
"                     .        >"+nl+
"         `       '          \\/> "+nl+
"             .     __________>,^"+nl+
"                `  \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"  `                            _"+nl+
"   `                     ===-^,/"+nl+
" `      `              '      >"+nl+
"     `                      \\/> "+nl+
"                   __________>,^"+nl+
"                   \\-=-=-=-=-=-/{я}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
" `                        '    _"+nl+
"  `                      ===-^,/"+nl+
"                              >"+nl+
"                            \\/> "+nl+
"                   __________>,^"+nl+
"                   \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                               _"+nl+
"                         ===%^,/"+nl+
"                              >"+nl+
"                            \\/> "+nl+
"                   __________>,^"+nl+
"                   \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                               \\"+nl+
"                         ---%^,/"+nl+
"                           /  >"+nl+
"                            _/> "+nl+
"                   __________>,^"+nl+
"                   \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                             _"+nl+
"                       ---%^,/ "+nl+
"                         /  >"+nl+
"                          _/>  _"+nl+
"                   _________>,^_\\"+nl+
"                   \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                       ===%^,"+nl+
"                            >"+nl+
"                           />  _"+nl+
"                   _______/_>,^_\\"+nl+
"                   \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                       ===-^,"+nl+
"                            >"+nl+
"                          _/>  _"+nl+
"                   _________>,^_\\"+nl+
"                   \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                       ===%^,"+nl+
"                            >"+nl+
"                          \\/>  _"+nl+
"                   _________>,^_\\"+nl+
"                   \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                       ===-^,"+nl+
"                            >"+nl+
"                          \\/>  _"+nl+
"                   _________>,^_\\"+nl+
"                   \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                       ===%^,"+nl+
"                            >"+nl+
"                          \\/>  _"+nl+
"                   _________>,^_\\"+nl+
"                   \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                       ---%^,"+nl+
"                  Rats.  /  >"+nl+
"                          _/>  _"+nl+
"                   _________>,^_\\"+nl+
"                   \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                       ---%^,"+nl+
"                  Rats.  /  >"+nl+
"                          _/>  _"+nl+
"                   _________>,^_\\"+nl+
"                   \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                       ---%^,"+nl+
"                  Rats.  /  >"+nl+
"                          _/>  _"+nl+
"                   _________>,^_\\"+nl+
"                 я  \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                       ---%^,"+nl+
"                  Rats.  /  >"+nl+
"                          _/>  _"+nl+
"                   _________>,^_\\"+nl+
"                   \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                       ---%^,"+nl+
"                  Rats.  /  >"+nl+
"                          _/>  _"+nl+
"                   _________>,^_\\"+nl+
"                   \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                       ===%^,"+nl+
"                            >"+nl+
"                          _/>  _"+nl+
"                   _________>,^_\\"+nl+
"                   \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                       ===-^,"+nl+
"                            >"+nl+
"                          _/>  _"+nl+
"                   _________>,^_\\"+nl+
"                   \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                       ===%^,"+nl+
"                            >"+nl+
"                          _/>  _"+nl+
"                   _________>,^_\\"+nl+
"                   \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                       ===%^,"+nl+
"                            >"+nl+
"                          _/>  _"+nl+
"                   _________>,^_\\"+nl+
"                   \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-я~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                       ---%^,"+nl+
"                         /  >"+nl+
"                           />  _"+nl+
"                   _______/_>,^_\\"+nl+
"                   \\-=-=-=-=-=-/{}"+nl+
"~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"+nl+
"-ejm97-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~",

" "+nl+
" "+nl+
" "+nl+
" "+nl+
" "+nl+
"                       ---%^,"+nl+
" I lost my fishing rod.  /  >"+nl+
"                           />  _"+nl+
"                   _______/_>,^_\\"+nl+
"                   \\-=-=-=-=-=-/{}"+nl+
"-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~"+nl+
"~ejm97~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-"], // "Fishing" taken from http://asciimator.net/kangaroo/fishing.html
];



for (var s = 0; s < spinners.length; ++s) {
  var spinner = spinners[s];
  var div = document.createElement('div');
  var el = document.createElement('pre');
  div.appendChild(el);
  document.body.appendChild(div);

  (function(spinner, el) {
    var i = 0;
    setInterval(function() {
      el.innerHTML = spinner[i];
      i = (i + 1) % spinner.length;
    }, 300);
  })(spinner, el);
}
pre {
  font-family: monospace;
  font-size: 1.5em;
  font-weight: bold;
  border: 1px solid #eee;
  display: inline-block;
  margin: .25em;
}

There's more @ cli-spinners, courtesy of Sindre Sorhus.

You can nab the JSON for them here.

I JavaScriptified them here: JsBin

Diahann answered 6/9, 2012 at 17:20 Comment(3)
@ChrisThornton Fixed the link and inserted code into my answer.Diahann
Ingenious! Try adding one more. I saw this being used by npm update (Node.JS): ▌▀▐▄ It would look like there's a little clockwise spinner in that one character. The sort that you see everywhere these days.Unfasten
@Unfasten Added (5th one down).Diahann
S
90

Balloons...

. o O @ *
Sandeesandeep answered 21/4, 2010 at 18:23 Comment(2)
@RCIX I just did that with the '\a' character :)Ruben
I call it "cells" o 0 8 oo 00 88 ...Plexor
R
85

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.

Rhino answered 21/4, 2010 at 19:13 Comment(3)
@Thorbjørn - Thanks for catching that, I'll update my answer and post an alternate link.Rhino
Mirrors if AC⚡DC video on youtube is blocked in your country: dailymotion, boreme.com.Fulminant
It's called en.wikipedia.org/wiki/Newton%27s_cradleIvar
M
67

Definitely LOLLERSKATES!

    /\O    |    _O    |      O
     /\/   |   //|_   |     /_
    /\     |    |     |     |\
   /  \    |   /|     |    / |
 LOL  LOL  |   LLOL   |  LOLLOL
-----------+----------+-----------
  Frame 0  | Frame 1  |  Frame 2   
Mendy answered 24/4, 2010 at 19:3 Comment(1)
The "OMGWTFBBQ!!!1" is a little to big for this: kreativekorp.com/miscpages/omgwtfbbq/omgwtfbbq.gif , so is its extended version: i234.photobucket.com/albums/ee298/davidshek/omgwtfbbq.gifMendy
C
29

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.

Cowbane answered 21/4, 2010 at 18:40 Comment(1)
This looks awesome, took it for my site :)Elaboration
B
23

I've used a cycle of

Working. 
Working..
Working...

Inspirational I know

Burne answered 21/4, 2010 at 18:47 Comment(0)
R
21

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%

|||||| 25%

||||||||||||||||||||| 100%
Rutilant answered 6/9, 2010 at 9:2 Comment(3)
I love the simplicity!Inhabiter
If we don't know the exact progress we can just do like #### 4/7 or somethingBallade
:) If you know 4/7 then you know double percent = (4 * 100.0) / 7; and can display it with the precision you want.Foah
U
16

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

>))'>
    >))'>
        >))'>
    <'((<
<'((<
Unkempt answered 13/5, 2010 at 15:2 Comment(0)
J
15

Try these

  • '+', 'x'
  • 'v', '<', '^', '>'
Jaela answered 21/4, 2010 at 18:22 Comment(0)
R
15

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

Rutilant answered 6/9, 2010 at 9:8 Comment(1)
links are dead :-(Lentiginous
S
13

In Javascript using one jQuery selectors:

var spins = [
    "←↖↑↗→↘↓↙",
    "▁▃▄▅▆▇█▇▆▅▄▃",
    "▉▊▋▌▍▎▏▎▍▌▋▊▉",
    "▖▘▝▗",
    "┤┘┴└├┌┬┐",
    "◢◣◤◥",
    "◰ ◳ ◲ ◱",
    "◴◷◶◵",
    "◐◓◑◒",
    "|/-\\"];

    var spin = spins[0],
        title$ = $('title'),
        i=0;

    setInterval(function() {
        i = i==spin.length-1 ? 0 : ++i;
        title$.text('('+ spin[i] +') Loading...');
    },300);
Serous answered 24/12, 2011 at 23:35 Comment(2)
javascript is available in very few consolesEllery
@NewAlexandria it wouldn't be available anyways since this uses jQuery which only works in browsersBarkentine
B
10

I'm glad I'm not the only one crazy enough to waste time on this!

Here are my favourites (some using dos ascii codes):

             classic: "/-\\|";
       bouncing ball: ".oOo";
better bouncing ball: [46, 111, 79, 248, 79, 111]; // (.oO°Oo.)

[180, 217, 193, 192, 195, 218, 194, 191];  // ┤ ┘ ┴ └ ├ ┌ ┬ ┐
[185, 188, 202, 200, 204, 201, 203, 187];  // double piped version of that 
[219, 220, 223];                           // block colours
Boz answered 4/5, 2012 at 15:20 Comment(0)
C
5

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();
        }
    }
}
Cragsman answered 21/4, 2010 at 20:50 Comment(3)
Very nice! It looks great with char[,] matrix = new char[Console.WindowWidth-1, Console.WindowHeight-1]; in Spinner()Tombaugh
Change * with , for a blizzard.Widera
You should probably mention this is written in C#...Maxie
B
4

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

Billups answered 21/4, 2010 at 18:24 Comment(0)
T
4

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.

Triploid answered 21/4, 2010 at 20:1 Comment(4)
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.Mainz
For the lazy: So what's the effect, then?Quinquereme
Didn't compile for me on VS2010 without a cast: fputs((const char*)&j,stderr); ... and it was a bit of a disappointment when it did.Cammycamomile
@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.Triploid
N
4

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.

Nonstandard answered 21/4, 2010 at 21:22 Comment(0)
S
3

I have seen

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

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

Switcheroo answered 21/4, 2010 at 19:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.