public class Carpet { // Draw a 2*size by 2*size Sierpinski carpet of level n // having its center at (x,y). static void carpet(double x, double y, double size, int n) { StdDraw.filledSquare(x, y, size); } public static void main(String[] args) { int n = Integer.parseInt(args[0]); carpet(0.5, 0.5, 0.5, n); } }