我无法发布任何图片,因为我刚刚创建了这个帐户,但这是它的链接:
https://www.cs.umd.edu/class/fall2013/cmsc131-12/Fall2013Proj2/InformationAndPictures.htm
if (countryCode == 2){
if (height % 3 == 0 && width % 3 == 0 ){
for (int col = 0; col < width; col = col + 1){
for (int row = 0; row < height; row = row + 1){
grid.setColor(row , col, Color.YELLOW);
}
}
for (int col = 0; col < width; col = col + 1){
for (int row = height / 3; row < height; row = row + 1){
grid.setColor(row, col, Color.GREEN);
}
}
for (int col = 0; col < width; col = col + 1){
for (int row = height / 2 + 1; row < height; row = row + 1){
grid.setColor(row , col, Color.RED);
}
}
}
}
到目前为止,这就是我所拥有的,但我无法正确平衡红色和绿色我知道我的方程式有问题,但我无法弄清楚。