Skip to main content
Commonmark migration
Source Link

#PHP, 90 83 80 78 77 Bytes

PHP, 90 83 80 78 77 Bytes

77:

The closing ; is not needed.

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

78:

While looking for another workaround to get a 0 initially without initializing the variable I came up with this:

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

Changed back to echo to win a few bytes as I only used printf to force-format as int. By incrementing the incremented $i with 0 I get a valid integer. By using single quotes as string delimiter the backslash does not need to be escaped, resulting in another byte freed

80:

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

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

83:

Removed init of a variable with the loaderstates.

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

90:

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.

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

#PHP, 90 83 80 78 77 Bytes

77:

The closing ; is not needed.

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

78:

While looking for another workaround to get a 0 initially without initializing the variable I came up with this:

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

Changed back to echo to win a few bytes as I only used printf to force-format as int. By incrementing the incremented $i with 0 I get a valid integer. By using single quotes as string delimiter the backslash does not need to be escaped, resulting in another byte freed

80:

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

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

83:

Removed init of a variable with the loaderstates.

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

90:

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.

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

PHP, 90 83 80 78 77 Bytes

77:

The closing ; is not needed.

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

78:

While looking for another workaround to get a 0 initially without initializing the variable I came up with this:

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

Changed back to echo to win a few bytes as I only used printf to force-format as int. By incrementing the incremented $i with 0 I get a valid integer. By using single quotes as string delimiter the backslash does not need to be escaped, resulting in another byte freed

80:

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

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

83:

Removed init of a variable with the loaderstates.

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

90:

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.

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

#PHP, 90 83 80 7878 77 Bytes

7877:

The closing ; is not needed.

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

78:

While looking for another workaround to get a 0 initially without initializing the variable I came up with this:

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

Changed back to echo to win a few bytes as I only used printf to force-format as int. By incrementing the incremented $i with 0 I get a valid integer. By using single quotes as string delimiter the backslash does not need to be escaped, resulting in another byte freed

80:

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

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

83:

Removed init of a variable with the loaderstates.

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

90:

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.

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

#PHP, 90 83 80 78 Bytes

78:

While looking for another workaround to get a 0 initially without initializing the variable I came up with this:

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

Changed back to echo to win a few bytes as I only used printf to force-format as int. By incrementing the incremented $i with 0 I get a valid integer. By using single quotes as string delimiter the backslash does not need to be escaped, resulting in another byte freed

80:

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

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

83:

Removed init of a variable with the loaderstates.

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

90:

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.

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

#PHP, 90 83 80 78 77 Bytes

77:

The closing ; is not needed.

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

78:

While looking for another workaround to get a 0 initially without initializing the variable I came up with this:

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

Changed back to echo to win a few bytes as I only used printf to force-format as int. By incrementing the incremented $i with 0 I get a valid integer. By using single quotes as string delimiter the backslash does not need to be escaped, resulting in another byte freed

80:

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

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

83:

Removed init of a variable with the loaderstates.

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

90:

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.

for($l='-\|/';$i<101;usleep(rand(0,750)*1e3),$i++)printf("\rloading %s %d%%",$l[$i%4],$i);
Golfed some more and moved some text around to keep overview/clarity to the stages of golfing.
Source Link

#PHP, 90 83 8080 78 Bytes

78:

While looking for another workaround to get a 0 initially without initializing the variable I came up with this:

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

Changed back to echo to win a few bytes as I only used printf to force-format as int. By incrementing the incremented $i with 0 I get a valid integer. By using single quotes as string delimiter the backslash does not need to be escaped, resulting in another byte freed

80:

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 the83:

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

83:

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

Moving90:

I tried removing the incrementinit of $i from the last for-section to gain some bytes, as I had to add quite a few to enable the prinf gave me another 3 offloader animation. (See comments below)

90:printf adds 2 as opposed to echo, but formatting NULL as an integer results in 0.

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

#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);

#PHP, 90 83 80 78 Bytes

78:

While looking for another workaround to get a 0 initially without initializing the variable I came up with this:

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

Changed back to echo to win a few bytes as I only used printf to force-format as int. By incrementing the incremented $i with 0 I get a valid integer. By using single quotes as string delimiter the backslash does not need to be escaped, resulting in another byte freed

80:

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

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

83:

Removed init of a variable with the loaderstates.

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

90:

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.

for($l='-\|/';$i<101;usleep(rand(0,750)*1e3),$i++)printf("\rloading %s %d%%",$l[$i%4],$i);
Changed formatting of the post (most recent on top) and corrected the title
Source Link
Loading
Shaved of another 3 by moving $i increment
Source Link
Loading
added 118 characters in body
Source Link
Loading
Source Link
Loading