function randInt(range) {
    return Math.random() * range | 0;
  }
creates a random integer between 0 and range - 1 inclusive.
@param {number} range
@return {number} random value between 0 and range - 1 inclusive.