nextFromMax method

int nextFromMax(
  1. int maxValue
)

Get the next random integer exclusive to maxValue.

Implementation

int nextFromMax(int maxValue) {
  if (maxValue < 0) {
    throw ArgumentError("maxValue less then zero");
  }

  int retVal = (sample() * maxValue).toInt();
  return retVal;
}