A few days ago, you helped me to find out an algorithm for generating random strength values in an online game (thx especially John Rasch).
function getRandomStrength($quality) {
$rand = mt_rand()/mt_getrandmax();
$value = round(pow(M_E, ($rand - 1.033) / -0.45), 1);
return $value;
}
This function generates values between 1.1 and 9.9. Now I want to adjust this function so that it gives me values of the same probability but in another interval, e.g. 1.5 to 8.0. It would be perfect if you could achieve this with additional parameters.
It would be great if you could help me. Thanks in advance!