Tuesday, 28 June 2016

6. Assume an image named image is all green

6. Assume an image named image is all green

and we execute the following code segment.

1
2
3
4
5
6
7
8
w = image.getWidth();
for (var pixel of image.values()) {
x = pixel.getX();
y = pixel.getY();
if (x + y < w) {
pixel.setRed(255);
}
}

Which one of the following is the image generated by this code segment?

No comments:

Post a Comment