src/main/java/org/teachingextensions/logo/utils/PuzzleUtils/Puzzle.java
public int getDistanceToGoal()
  {
    int distance = 0;
    for (int i = 0; i < cells.length; i++)
    {
      distance += getDistance(i, cells[i]);
    }
    return distance;
  }
public int getDistanceToGoal()
  {
    int distance = 0;
    for (int i = 0; i < cells.length; i++)
    {
      distance += getDistance(i, cells[i]);
    }
    return distance;
  }
public int getDistanceToGoal ( ) { int distance = 0 ; for ( int i = 0 ; i < cells . length ; i ++ ) { distance += getDistance ( i , cells [ i ] ) ; } return distance ; }
Calculate the distance between the goal by summing the distance between each cell and its goal.

@return The distance to the goal.
Calculate the distance between the goal by summing the distance between each cell and its goal .