public static boolean arePointsAdjacent(Point a, Point b)
    {
        int dx = a.x - b.x;
        int dy = a.y - b.y;
        
        if((Math.abs(dx)==1 && dy==0)||(Math.abs(dy)==1 && dx==0))
        {
            return true;
        }
        else {
            return false;
        }
    }