int CELL_NUM = 200;
int CELL_SIZE = 10;
void setup(){
size(640, 640);
noStroke();
background(255);
}
void draw(){
translate(mouseX, mouseY);
rotate(frameCount * 0.05);
for(int x = 0; x <CELL_NUM; x++){
for(int y = 0; y < CELL_NUM; y++){
if(frameCount % 2 == 1 && (x + y) % 2 == 0){
fill(0);
rect(x * CELL_SIZE - CELL_SIZE * CELL_NUM / 2, y * CELL_SIZE - CELL_SIZE * CELL_NUM / 2, CELL_SIZE, CELL_SIZE);
} else if(frameCount % 2 == 0 && (x + y) % 2 == 1){
fill(255);
rect(x * CELL_SIZE - CELL_SIZE * CELL_NUM / 2, y * CELL_SIZE - CELL_SIZE * CELL_NUM / 2, CELL_SIZE, CELL_SIZE);
}
}
}
}