import acm.graphics.*; import acm.program.*; import java.awt.*;

The color must switch based on both the row and column index to create the staggered effect. The Logic Behind the Fix

Using the same variable (like i ) for both loops. This causes the loops to crash into each other.

: This is the "magic" math. By adding the row index and column index together and checking if the sum is even or odd, you create a perfect alternating pattern. Without this, every row would look identical.