Advertisement
Guest User

Untitled

a guest
Jun 10th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <unistd.h>
  3.  
  4. void clear_screen(void)
  5. {
  6.         printf("\e[2J\e[H");
  7.         fflush(stdout);
  8. }
  9.  
  10. void wait_message(const char *str)
  11. {
  12.         while (1) {
  13.                 printf("%s", str);
  14.                 for (int i = 0; i < 5; i++) {
  15.                         putchar('.');
  16.                         fflush(stdout);
  17.                         sleep(1);
  18.                 }
  19.                 clear_screen();
  20.         }
  21. }
  22.  
  23. int main(void)
  24. {
  25.         wait_message("so bored");
  26.         return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement