PHP:
if(rand(1,20) == 1) $prize = 200;
else $prize = 3;
JS:
if(Math.random() < 1/20) prize = 200;
else prize = 3;
This kind of thing is quite trivial 😉
3
solved How to create a random prize generator with percentage? [closed]
PHP:
if(rand(1,20) == 1) $prize = 200;
else $prize = 3;
JS:
if(Math.random() < 1/20) prize = 200;
else prize = 3;
This kind of thing is quite trivial 😉
3
solved How to create a random prize generator with percentage? [closed]