title: Calculating Manhattan Distance
body: <p>I'm implementing NxN puzzels in Java 2D array int[][] state. am required to use the Manhattan heuristic in the following way: </p>
  
  <pre><code>             the sum of the vertical and horizontal distances from 
                  the current node to the goal node/tile
  
                                  +(plus)
  
      the number of moves to reach the goal node from the initial position
  </code></pre>
  
  <p>At the moment I don't know how to go further. Am a beginner in puzzle game programming with 2D arrays so am having trouble to understand certain concepts. How can I write this code in Java?</p>