title: Javascript battleship game - prompt not responding
body: <p>I'm trying to follow along with my javascript book &quot;headfirst javascript programming&quot;....</p>
  <p>the assignment is to make a simplified battleship game. It was working until I added more code... Now the prompt is not showing. Im sure im doing something wrong with the curly brackets. I just want the prompt &quot;Ready, aim, fire! (enter a number from 0-6):&quot; to appear when launching the browser and for it to respond to numerical inputs.</p>
  <p>Can anyone quickly tell me why im screwing up? thank you! here is my simple code ---&gt;&gt;&gt;</p>
  <pre><code>//declare variables
  var location1 = 3;
  var location2 = 4;
  var location3 = 5;
  var guess;
  var hits = 0;
  var guesses = 0;
  var isSunk = false;
  
  //loop
  while (isSunk == false) {
  
  //get
      guess = prompt(&quot;Ready, aim, fire! (enter a number from 0-6):&quot;);
      if (guess &lt; 0 || guess &gt; 6) {
          alert(&quot;Please enter a valid cell number!&quot;);
      } else {
  //add
        guesses = guesses + 1;
  //if
          if (guess == location1 || guess == location2 || guess == location 3) {
              alet(&quot;HIT!&quot;);
              hits = hits + 1;
              if (hits == 3) {
                  isSunk = true;
                  alert(&quot;You sank my battleship!&quot;);
              }
          } else {
              alert(&quot;MISS&quot;);
          }
      }
  }
  
  var stats = &quot;You took &quot; + guesses + &quot;guesses to sink the battleship, &quot; +
                  &quot;which means your shooting accuracry was &quot; + (3/guesses);
  alert(stats);
  </code></pre>