public class CheckerBoard { public static void main(String[] args) { int N = Integer.parseInt(args[0]); StdDraw.setXscale(0, N); StdDraw.setYscale(0, N); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if ((i + j) % 2 != 0) StdDraw.setPenColor(StdDraw.BLACK); else StdDraw.setPenColor(StdDraw.RED); StdDraw.filledSquare(j + .5, i + .5, .5); } } StdDraw.show(10); } }