First, put this in global code
- Code: Select all
float rv;
void random(float first, float second)
{
rv = rand(first+second);
if (rv<first)
{
rv = first;
}
if (rv>second)
{
rv = second;
}
}
Now when ever you wanna make a random between 2 numbers, simply put this:
- Code: Select all
random(9, 32);
This will have rv store anything from 9 to 32, and everything in between. IF you want to use this without the decimals, than replace "float rv;" with "int rv"
Enjoy