Skip to main content
1 of 2
Abel Tom
  • 1.2k
  • 1
  • 7
  • 9

C 126 bytes

f(){i=0;char c[]="/-|\\";for(;i<101;i++){printf("\rloading %c %d %% ",c[rand()%4],i);fflush(stdout);usleep(1000*(rand()%75));}

Ungolfed version:

 void f()
 {
  int i=0;
  char c[]="/-|\\";
  for(;i<101;i++)
  {
    printf("\rloading %c %d %% ",c[rand()%4], i);
    fflush(stdout);
    usleep(1000*(rand()%75));  
  }
 } 
Abel Tom
  • 1.2k
  • 1
  • 7
  • 9