private static int[][] BresenhamLine(int x0, int y0, int x1, int y1){
        ArrayList<Point> points = new ArrayList<>();
        
        int dx = Math.abs(x1-x0);
        int dy = Math.abs(y1-y0);

        int sx = (x0 < x1 ? 1 : -1);
        int sy = (y0 < y1 ? 1 : -1);
        int err = dx-dy;

        while(true){
            points.add(new Point(x0,y0));
            if(x0 == x1 && y0 == y1)
                break;
            int e2 = 2 * err;
            if(e2 > -1 * dy){
                err = err - dy;
                x0 = x0 + sx;
            }
            if(e2 < dx){
                err = err + dx;
                y0 = y0 + sy;
            }
        }
        
        int[][] pArr = new int[points.size()][2];
        int i = 0;
        for(Point p : points){
            pArr[i][0] = p.x;
            pArr[i][1] = p.y;
            i++;
        }
        
        return pArr;
    }