fork(1) download
  1. <?php
  2. $a=['1','2','3'];
  3. foreach(range(1,100) as $i)
  4. switch ($s=random_int ( 1 , 100 )) {
  5. case $s<=10:echo $a[2];break;//10%
  6. case $s>=81:echo $a[1];break;//20%
  7. default: echo $a[0];//70%
  8. }
Success #stdin #stdout 0.02s 24288KB
stdin
Standard input is empty
stdout
2121121311211212211131111111111111111111211112112211113211111112111111111311111121111112211112211212