title: How to make a Loaded Dice
body: <p>I am creating a subclass of this Dice class called Loaded Dice that will make a dice roll loaded and by a certain percent, It would look a bit like;</p>
  
  <pre><code>public LoadedDice (int anumSides,int loadVal, double loadPct)
  </code></pre>
  
  <p>but I don't know where to start, I've gotten some ideas to create an <code>ArrayList</code> and make it have more of one number then the others and pick randomly from there but there's got to be a cleaner way to do it then that right?</p>
  
  <pre><code>public class Dice
  {
  
      // --------------------------------------------
      // Instance Variables
      // --------------------------------------------
      private ArrayList&lt;Die&gt;  dieArray;
  
      // ------------------------------------------------
      // Constructors
      // -----------------------------------------------
      /**
       * Default Constructor creates 2 6 sided dice
       */
      public Dice ()
      {
          dieArray = new ArrayList&lt;Die&gt;();
          dieArray.add(new Die());
          dieArray.add(new Die());
      }
  
      /**
       * Takes an ArrayList of die objects to use
       */
      public Dice (ArrayList&lt;Die&gt; someDice)
      {
          dieArray.addAll(someDice);
      }
  
      /**
       * Takes in 1 int (# of dice), which creates that number of 6-sided
       * dice
       */
      public Dice (int numberOfDice)
      {
          dieArray = new ArrayList&lt;Die&gt;();
          for (int i = 0; i &lt; numberOfDice; i++)
          {
              dieArray.add(new Die());
          }
      }
  
      /**
       * Takes in 2 ints (# of dice, # of sides per die) which creates that
       * number of dice with that number of sides per die
       */
      public Dice (int numberOfDice, int numberOfSides)
      {
          dieArray = new ArrayList&lt;Die&gt;();
          for (int i = 0; i &lt; numberOfDice; i++)
          {
              dieArray.add(new Die(numberOfSides));
          }
      }
  
      // -------------------------------------------------
      // Class Methods
      // -------------------------------------------------
      /**
       * ContainsDice: takes 0 parameters, and returns a string value
       * representing all of the dice
       */
      public String ContainsDice ()
      {
          String dieString = new String();
          for (int i = 0; i &lt; dieArray.size(); i++)
          {
  
              dieString += (dieArray.get(i) + " ");
          }
          return dieString;
      }
  
      /**
       * Roll: takes 0 parameters, and returns an int value that is the sum
       * of all the dice rolled
       */
      public int Roll ()
      {
          int value = 0;
  
          for (int i = 0; i &lt; dieArray.size(); i++)
          {
              value = value + dieArray.get(i).roll();
          }
  
          return value;
      }
  
      /**
       * Add: Takes a Die object as an input parameter and adds it to the
       * current Dice
       */
      public void Add (Die newDie)
      {
          dieArray.add(newDie);
      }
  }
  </code></pre>
  
  <p>Also all of the Dice class is coming from a die class that I created. If needed I can provide that as well.</p>