/* The original version of this program can be found at http://damb.dk */
#include <windows.h>
#include <stdio.h>
const char *const ben[] =
{
" )))",
" |||",
" (((",
" |||"
};
int main(void)
{
HANDLE con = GetStdHandle(STD_OUTPUT_HANDLE);
int i;
COORD coord;
SetConsoleTextAttribute(con, FOREGROUND_BLUE | FOREGROUND_INTENSITY);
coord.X = 0;
for(i = 0; i < 3; i++)
{
coord.Y = i;
SetConsoleCursorPosition(con, coord);
printf(" ");
fflush(stdout);
}
for(i = 0; i < 40; i++)
{
coord.X = i;
coord.Y = 0;
SetConsoleCursorPosition(con, coord);
printf(ben[i%4]);
fflush(stdout);
coord.Y = 1;
SetConsoleCursorPosition(con, coord);
printf(" -OOOOO:");
fflush(stdout);
coord.Y = 2;
SetConsoleCursorPosition(con, coord);
printf(ben[i%4]);
fflush(stdout);
Sleep(300);
}
SetConsoleTextAttribute(con, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
return 0;
}