我是编程新手!我正在尝试使用 Processing(一种使用与 Java 类似的语法的语言)制作棋盘。
为什么这不起作用?
void setup(){
//5.b In setup() set the size to 350, 350
size(350,350);
for (int y = 0; y < 8; y = y++){
for (int x = 0; x < 8; x++){
if ((y+x+1) % 2 == 0 ){
fill(255);
}else{
fill(0);
}
rect(50*x,50*y,50,50);
}
}
}
```
Run Code Online (Sandbox Code Playgroud) processing ×1