Bee-Ant wrote:
- Code: Select all
float GetRandomBetween(float ii,float jj)
{
float ij=rand(max(ii,jj)-min(ii,jj));
return ij+min(ii,jj);
}
With this code, you can return any number between any number.
If you want to return a number between negative with positive then just type:
- Code: Select all
textNumber=GetRandomBetween(-5,5); //or
textNumber=GetRandomBetween(5,-5);
Please try first before you ask