title: How can i make a "dice" that randomly generates a number 1-6 EACH time it is used?
body: <p>Right now i am using </p>
  
  <pre><code> int die = (int)(6.0 * Math.random()) + 1;
  </code></pre>
  
  <p>This does not work for the loop i am trying to create. This is the method i am using.</p>
  
  <pre><code>public void computerRoll()
  { 
  
   do { roll();
        System.out.println("Roll:"+ die);
        computerScore += die;
       } while (computerScore &lt;= 20 &amp;&amp; die &gt;=2 &amp;&amp; die &lt;=6 );
       if (computerScore &gt;=20)
          computerHold();
  
       if (die == 1)
          switchTurn();
  
   }
  </code></pre>
  
  <p>The roll() method just simply has the previous line of code in it, "int die = (int)(6.0 * Math.random()) + 1;" i have tried moving it around or even making a place holder for it but if i execute the method and the number is not a 1, it just prints that number until it reaches twenty. 
  I am trying to create a "dice" that will make a NEW number each time it is used.</p>