#include #include /* for sleep; may be different or unnecessary on your machine */ #define N 80 /* length of line */ main() { char line[N]; /* background, all blanks */ int i; /* Initialize the array to all blanks, terminated with a '\0'. */ for (i = 0; i < N - 1; ++i) { line[i] = ' '; } line[i] = '\0'; /* Put '\0' into line[N-1]. */ for (i = 0; i < N - 3; ++i) { /* Erase the last char of the previous rocket, if there was one. */ if (i > 0) { line[i-1] = ' '; } /* Draw the rocket. */ line[i] = '='; line[i+1] = '='; line[i+2] = '>'; printf("%s\r", line); fflush(stdout); /* Output the above characters immediately. */ sleep(1); /* for 1 second */ } }