9.1.7 Checkerboard V2 Codehs

if ((row + col) % 2 == 0) square.setFillColor(Color.RED); else square.setFillColor(Color.BLACK);

To create the Checkerboard V2 pattern, students must employ a systematic and algorithmic approach. The solution involves using nested loops to iterate over the grid, making decisions about the color of each square based on its position. A common strategy involves using the sum of the row and column indices to determine whether a square should be black or white. 9.1.7 Checkerboard V2 Codehs