Guest User

Untitled

a guest
Jan 18th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #include <unistd.h>
  2.  
  3. void colle22(char *box)
  4. {
  5. int i;
  6. int j;
  7. int k;
  8. int l;
  9.  
  10. i = 0;
  11. j = 0;
  12. k = my_strlen(box) + 1;
  13. while (1)
  14. {
  15. usleep(400000);
  16. if (i == my_strlen(box) + 1)
  17. i = 0;
  18. j = 0;
  19. my_putchar('\r');
  20. while (j < i)
  21. {
  22. my_putchar(' ');
  23. j = j + 1;
  24. }
  25. l = i;
  26. while (box[l])
  27. {
  28. my_putchar(box[l]);
  29. l = l + 1;
  30. }
  31. l = 0;
  32. while (i > l)
  33. {
  34. my_putchar(box[l]);
  35. l = l + 1;
  36. }
  37. while (j < my_strlen(box))
  38. {
  39. my_putchar(' ');
  40. j = j + 1;
  41. }
  42. i = i + 1;
  43. }
  44. }
  45.  
  46. int main()
  47. {
  48. char box[] = "123456789";
  49.  
  50. colle22(box);
  51. }
Add Comment
Please, Sign In to add comment