title: boolean is assigned but never accessed
body: <p>I'm just trying to create a GuessMyNumber game and here is my code:</p>
  
  <pre><code>import java.util.Random;
  import java.util.Scanner;
  
  public class classic {
  public static void main(String[] args) {
      Random rand = new Random();
      boolean beaten = false;
      int number;
      int randn = rand.nextInt(99);
      //System.out.println(randn);
      System.out.println("What is my number? Guess it!");
      Scanner input = new Scanner(System.in);
      int counter = 0;
      int counter2 = 0;
       while(beaten = true){
              number = input.nextInt();
              if (number == randn) {
                  System.out.println("Correct!");
                  beaten = true;
              }
              if (number &lt; randn) {
                  System.out.println(number + " is too low");
              }
              if (number &gt; randn) {
                  System.out.println(number + " is too high");
              }
          }
      }
  }
  </code></pre>
  
  <p>In the while loop I set <code>beaten = true</code> but still, while loop continues</p>
  
  <p>What am I doing wrong here?</p>