9.1.7 Checkerboard V2 Codehs [best]
for (int i = 0; i < rows; i++) for (int j = 0; j < cols; j++) if ((i + j) % 2 == 0) System.out.print("@"); else System.out.print(".");
GRect square = new GRect(x, y, sqWidth, sqHeight); square.setFilled(true); 9.1.7 Checkerboard V2 Codehs
To solve 9.1.7 Checkerboard V2 , you need to be comfortable with these four pillars: for (int i = 0; i < rows;
If the sum of the row index ( i ) and column index ( j ) is even, the value should be 1 . If it is odd, the value should be 0 (or vice versa). for (int i = 0
