title: Do-While loop is exiting prematurely
body: <p>I tried writing a PvP Chess program. However, when an invalid move is played, it ends the turn. </p>
  
  <pre><code>        do
          {
              boolean q = askMove(board, white , in);
              if (q == true){
                  white.move = false;
                  break;
              }
              else
                  continue;
          } while (white.move == true);
          do
          {
              //boardDisplay (board);
              boolean w = askMove(board, black, in);
              if (w == true){
                  black.move = false;
                  break;
              }
              else
                  continue;
          }while (black.move == true);
      }
  </code></pre>
  
  <p>In the code, q takes true, if the initial and final co-ordinates of a piece are not the same.</p>
  
  <pre><code>    if (x1 != x2 || y1 != y2)
              return true;
          return false;
  </code></pre>
  
  <p>When I execute this code,</p>
  
  <p><a href="http://i.stack.imgur.com/3FDsg.png" rel="nofollow">First move is made</a></p>
  
  <p>So, if I play the 2nd invalid, the 2nd move should replay, because (q == false)
  However,</p>
  
  <p>The code should only trigger 'you can't move an enemy piece' only when it is the wrong player's turn. However, it triggers when I try to play a valid move as well.</p>
  
  <p><a href="http://i.stack.imgur.com/bIuQs.png" rel="nofollow">It says that I'm using an enemy piece!</a></p>
  
  <p>Even though I wrote:</p>
  
  <pre><code>   player p
      if (board[x1][y1].initPiece.name.charAt(0) != p.colour)
          System.out.println ("you cannot move an enemy piece");
  </code></pre>
  
  <p>Help is appreciated.</p>