MADS: Introduce another getRandomNumber function with 2 parameters
This commit is contained in:
parent
eb82e63398
commit
c42e831817
5 changed files with 12 additions and 5 deletions
|
@ -107,6 +107,12 @@ int MADSEngine::getRandomNumber(int maxNumber) {
|
|||
return _randomSource.getRandomNumber(maxNumber);
|
||||
}
|
||||
|
||||
int MADSEngine::getRandomNumber(int minNumber, int maxNumber) {
|
||||
int range = maxNumber - minNumber;
|
||||
|
||||
return minNumber + _randomSource.getRandomNumber(range);
|
||||
}
|
||||
|
||||
int MADSEngine::hypotenuse(int xv, int yv) {
|
||||
return (int)sqrt((double)(xv * xv + yv * yv));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue