title: if-else statements and 2d arrays
body: <p>I am writing a method that checks to see if certain moves of a checkers game are valid by returning true or false. My code works fine when I want to move diagonally (not jumping). However, when I try to see if my piece can jump across another piece, nothing gets returned (no false, no true, no error message, just blank). I have a <code>setLocation</code> method that takes three parameters of the checkers board column, row, and piece color which places a checkers piece at the said location on the board.</p>
  
  <p>How can I get my code to return true or false if I have pieces on the board set and I want to see if a piece can jump over an opposing color piece? curRow and curCol are just the current row and column that the piece is at. destRow and destCol are the destination that I want my piece to go to.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>if (board[curCol][curRow].equals(Piece.WHITE)){
      boolean valid=false;
      if ((curRow+1==destRow&amp;&amp;curCol+1==destCol)&amp;&amp;board[destRow][destCol].equals(Piece.NONE)){
          valid=true;
      }else if ((curRow+1==destRow&amp;&amp;curCol-1==destCol)&amp;&amp;board[destRow][destCol].equals(Piece.NONE)){
          valid=true;
      //jumps up right over piece 
      }else if ((curRow+2==destRow&amp;&amp;curCol+2==destCol)&amp;&amp;board[destRow-1][destCol-1].equals(Piece.BLACK)){
          valid=true;
      //jumps up left over piece
      else if ((curRow+2==destRow&amp;&amp;curCol-2==destCol)&amp;&amp;(board[destRow-1][destCol+1].equals(Piece.BLACK))){
          valid=true;
      }else{
          return valid;
      }
      return valid;
  }
  </code></pre>