title: Won't update the value
body: <p>I'm making a very basic automatic "Cookie Clicker" program and I got a problem with this row of code:</p>
  
  <pre><code>z = Math.ceil(15*java.lang.Math.pow(1.15, x));
  </code></pre>
  
  <p>when x gets updated in the if-statement this row of code doesn't seem to understand that and z keep on using x's initialized value (which is 0) and stays as 15 (15*1.15^0).</p>
  
  <p>Do anyone know what to do?</p>
  
  <pre><code>public class Tryout {
  
  public static void main(String[] args) {
      // TODO Auto-generated method stub
      double x = 0;               //Number of Cookie Clickers
      double z;                   // Cost of the Cookie Clickers
      double cookies = 0;         //Amount of Cookies
      double count = 0;           //Additional amount of cookies per second from the Cookie Clickers
      final double constant = 0.1; //Amount of CPS (cookies per second) you get from 1 Cookie Clicker
      z = Math.ceil(15*java.lang.Math.pow(1.15, x)); //with 0 CC the cost is 15, with 1 CC the cost is 18, with 2 CC...
      while (1&gt;0) {               // the game loop, (infinity loop)
          if(cookies &gt;= z) {  //If you got enough cookies you autobuy a new CC and the number of CC's increase as well as the cost of a CC
              System.out.println("cookies" + cookies); //Amount of cookies before you buy
              System.out.println("You bought a new Cookie Clicker; +0.1 cookie each second!");
              System.out.println(cookies + " - " + z + " = " + (cookies - z));
              cookies = cookies - z;
              x++;
          }
  
  
          try {  //delayer (Uptades 1 time per second)
              Thread.sleep(1000);
              } catch (InterruptedException ex) {
                  Thread.currentThread().interrupt();
              }
  
          count = x*constant;
          cookies = cookies + 1 + count;
          Math.round(cookies);
          System.out.println("cookies; " + cookies);          // Your current amount of cookies
      }
      }
      }
  </code></pre>