Rand_GetBetween

This commit is contained in:
2021-04-26 23:54:56 +02:00
committed by Valeriano A.R
parent 80a15daa86
commit 7482cb6868
2 changed files with 11 additions and 0 deletions

View File

@@ -341,6 +341,13 @@ unsigned Rand_Get() {
return (val);
}
unsigned Rand_GetBetween(int min, int max) {
if (min == max) {
return max;
}
return (Rand_Get() % (max - min)) + min;
}
/////////////////////////////
// Print
//