title: Dice Rolling loop
body: <p>I am trying to make a method with java that includes the simulation of rolling three dice, and it counts how many times the three six-sided dice must be rolled until the values showing are all different. I tried to create it while using a while loop but it doesn't seem to even run although there aren't any compiler errors. Here's the code I have so far:</p>
  
  <pre><code>public class Rollin {
      public static void diceGenerator() {
          int numOfRolls = 0; //starts at zero for the number of rolls
          int x = ((int)(Math.random() * 6 +1)); //simulation of three dice
          int y = ((int)(Math.random() * 6 +1));
          int z = ((int)(Math.random() * 6 +1));
          while(!(x != y &amp;&amp; y != z &amp;&amp; x != z)) { // to check if the dice have any similar numbers
              numOfRolls++; // counting the number of rolls
          }
          System.out.println(numOfRolls); //prints the number of rolls
      }
  }
  </code></pre>