- Code: Select all
int random(int maxi, int mini)//This code was made by Game-a-Gogo a.k.a. Frederic Duguay
{
int range=maxi-mini;
if(range<0)
{
return 0;//Means that mini is higher then maxi
}
else
{
return rand(range)+mini;
}
}
then you could use it like: random(100,10); so it would give out a number between 100 and 10, this also works for negative.
Maybe I should also make one for double
NOTE: PUT THIS IN THE GLOBAL CODE!!!