Como tudo que eu faço eu quero complicar (a Marina e o Pedro concordam), decidi que queria mudar a cor das bolinhas do tabuleiro de go ao clicar no mouse. Marina disse que eu precisaria fazer um por um caso quisesse fazer isso individualmente, mas como sou totalmente descrente e gosto de tirar a prova real de tudo, eu fui e concluí que precisava fazer exatamente o que a Marina me disse.
//Tabuleiro de Go Que Muda de Cor Coletivamente - 20/05/2026, 16:29
int branco = 255;
int preto = 0;
void setup(){
background (255);
size (500,500);
stroke (0);
strokeWeight(1);
line(width/2,0,250,500);
line(0,height/2,500,250);
line (width/4,0,125,500);
line (0,height/4,500,125);
line (width/2+width/4,0,375,500);
line (0,height/2+height/4,500,375);
}
void draw(){
fill (branco);
ellipse(width/2,height/4,10,10);
ellipse (width/4,height/2,10,10);
ellipse (width/2,height/2+height/4,10,10);
ellipse (width/2+width/4,height/2,10,10);
fill (preto);
ellipse (width/2,height/2,10,10);
ellipse (width/4,height/4,10,10);
ellipse (width/4,height/4+height/2,10,10);
ellipse (width/2+width/4,height/4,10,10);
ellipse (width/2+width/4,height/4+height/2,10,10);
}
void mouseClicked(){
if(branco == 255){
branco = 0;
} else {
branco = 255;
}
if(preto == 0){
preto = 255;
} else {
preto = 0;
}
}





