Ok, I have some kind of spin system, you spin and generate a random number.
If the number is less than 100, you win.
But how can I do this, the lower the number, the higher the coins you get
I currently have this:
public function getPrize($number) { $prize = $number * 250 / 2; if ($number < 100) { return '<span style="color: green;">You have won lucky <b>'.$prize.'</b> coins!</span>'; } else { return '<span style="color: red;">Sorry but, bad luck. You have won nothing! number: '.$number.'</span>'; } }
The prize is
$ prize. Basically, now I fasten it a lot by 250 and dividing by 2. so if I get the number "1". I will get a terrible prize.
How to do it?
source share