Skip to main content
4 of 7
Changed formatting of the post (most recent on top) and corrected the title

#PHP, 90 83 80 Bytes

Moving the increment of $i from the last for-section to the prinf gave me another 3 off. (See comments below)

80:

for(;$i<101;usleep(rand(1,75e4)))printf("\rloading %s %d%%","-\\|/"[$i%4],$i++);

I tried removing the init of $i to gain some bytes, as I had to add quite a few to enable the loader animation. printf adds 2 as opposed to echo, but formatting NULL as an integer results in 0.

83:

for(;$i<101;usleep(rand(1,75e4)),$i++)printf("\rloading %s %d%%","-\\|/"[$i%4],$i);

Moving the increment of $i from the last for-section to the prinf gave me another 3 off. (See comments below)

90:

for($l='-\|/';$i<101;usleep(rand(0,750)*1e3),$i++)printf("\rloading %s %d%%",$l[$i%4],$i);