title: How can I find a minimum and maximum from a dice roll?
body: <p>I want to find the minimum number, or maximum number, that I could possibly receive if put an X amount of dice and a X amount of dice sides. I know that if I only roll one dice then the minimum would be the "minrange" and the maximum would be the "minrange" + "numOfSides", but if I were to roll multiple dice with X amount of sides; how would I find the minimum/maximum number that could be generated?</p>
  
  <pre><code>double rollDice(int numOfDice, int numOfSides, int divide, int minrange) {
      int i = 0;
      subtotal = 0;
      while (i &lt; numOfDice) {
          roll = 0;
          roll = minrange + (rand() % numOfSides);
          subtotal += roll;
          i++;
      }
      return subtotal / divide;
  }
  </code></pre>