在控制台应用程序中,可以使用 ascii 微调器(如 GUI 等待光标)来指示工作正在完成。一个常见的微调器循环通过这 4 个字符:'|'、'/'、'-'、'\'
还有哪些其他循环动画序列可以为控制台应用程序增添趣味?
在控制台应用程序中,可以使用 ascii 微调器(如 GUI 等待光标)来指示工作正在完成。一个常见的微调器循环通过这 4 个字符:'|'、'/'、'-'、'\'
还有哪些其他循环动画序列可以为控制台应用程序增添趣味?
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
气球...
. o O @ *
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.
Definitely LOLLERSKATES!
/\O | _O | O
/\/ | //|_ | /_
/\ | | | |\
/ \ | /| | / |
LOL LOL | LLOL | LOLLOL
-----------+----------+-----------
Frame 0 | Frame 1 | Frame 2
Blink Inc. 曾经有一个名为 blinker 的 DOS 链接器。它在工作时会显示类似于此的动画:
(o)(o)
(-)(-)
(_)(_)
第一帧显示大约一秒钟,而另外两帧则每两秒钟短暂地动画一次,使命令行看起来像是在眨眼。实际上,效果非常酷。
链接器甚至可以选择眨眼,你可以选择哪只眼睛眨眼。
我用了一个循环
Working.
Working..
Working...
励志我知道
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%
fish
is a Python module that animates an ASCII fish going back and forth, and who doesn't like the rare console fish?
>))'>
>))'>
>))'>
<'((<
<'((<
试试这些
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
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);
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
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();
}
}
}
在一个应用程序中,我看到了 1,2,3,4,5,6,7,8,9,0。
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.
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.
I have seen
echo -e "\033[41;1m$1 \033[0m"
In bash to continually build a progress bar based on a block character.