Question: I would like to create an alternating checkerboard pattern in Java, preferably using for loops. The method that I need to call is this: The
I would like to create an alternating checkerboard pattern in Java, preferably using for loops. The method that I need to call is this:

The dimensions of the image are to be 1000 x 600 pixels. The checkerboard must fill the entire image, this is the code I have written so far, but it does not work.

Each square MUST BE 100 pixels by 100 pixels. The pixels are ordered in row major form.
The pattern I am trying to recreate is this one in the background of this image:

From what I can see, the pattern must be made with fb.setPixelFB(x-coordinate, y-coordinate, color)
public void setPixelFB (int x, int y, Color c) int index = (y*width + x); try pixel-buffer[ index] = c. getRGB(); catch (ArrayIndex0utofBoundsException e) System.err.println("FrameBuffer: Bad pixel coordinate "x + ", " y "" /Te.printStackTrace (System.exr)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
