title: Java program starts and stops without doing anything
body: <p>I'm trying to make a little, basic game of Nim. I'm a beginner in java. When I run the code, it just runs for a second, and stops without doing what I ask of it. It's probably a simple solution but I had to ask. Does anyone have any idea? Here's my code.</p>
  
  <pre><code>import java.util.Scanner;
  import java.util.Random;
  
  public class Nim {
  
      public static void main(String[] args) {
          Scanner input = new Scanner(System.in);
          Random rand = new Random();
  
          int playernum;
          int cpunum = rand.nextInt(3)+1;
          int gamenum = 21;
          boolean win = false;
          boolean turn = true;
  
          while((win = false) &amp;&amp; (turn = true)){
              System.out.println("The number is 21. Enter a number from 1 - 3");
              playernum = input.nextInt();
  
              int remaining = gamenum - playernum;
  
              System.out.println("The number is now " + remaining);
              turn = false;
  
              if((turn = false) &amp;&amp; (gamenum &gt; 0)){
                  System.out.println("Computer is thinking...");
                  try {
                      Thread.sleep(3000);
                  } catch (InterruptedException e) {
                      e.printStackTrace();
                  }
  
  
              }
          }
  
  
      }
  
  }
  </code></pre>