Skip to main content
generate more precise random for first variant
Source Link

PHP, 7174 bytes

With "include the empty string as a possible output".

while(0<$r=rand(0,9100)/310){echo $r<0.1?'':str_repeat('p',round($r))."\n";} 

Try it online!Try it online!


PHP, 52 bytes

while(0<$r=rand(0,9)){echo str_repeat('p',$r)."\n";} 

Try it online!

PHP, 71 bytes

With "include the empty string as a possible output".

while(0<$r=rand(0,9)/3){echo $r<0.1?'':str_repeat('p',round($r))."\n";} 

Try it online!


PHP, 52 bytes

while(0<$r=rand(0,9)){echo str_repeat('p',$r)."\n";} 

Try it online!

PHP, 74 bytes

With "include the empty string as a possible output".

while(0<$r=rand(0,100)/10){echo $r<0.1?'':str_repeat('p',round($r))."\n";} 

Try it online!


PHP, 52 bytes

while(0<$r=rand(0,9)){echo str_repeat('p',$r)."\n";} 

Try it online!

Source Link

PHP, 71 bytes

With "include the empty string as a possible output".

while(0<$r=rand(0,9)/3){echo $r<0.1?'':str_repeat('p',round($r))."\n";} 

Try it online!


PHP, 52 bytes

while(0<$r=rand(0,9)){echo str_repeat('p',$r)."\n";} 

Try it online!