#include <stdio.h>
#include <unistd.h>
#include <time.h>
#define C (c%'\r'?(c^9):c)
struct tm *
now (void)
{
usleep (200000);
time_t t = time (NULL);
return localtime (&t)->tm_wday;
}
int
main ()
{
char c = '\r' + '\r' + '\r';
setbuf (stdout, NULL);
while (now () > 4)
{
printf ("\r%c%c%c%c%c%c", C + 1, c, C + 2, C + 1, c ^= 9, C + 2);
}
}