Based on an idea by Steve Cooper. Written by Chris Piech.
Sometimes repeating patters can cause our eyes to see things that aren't there. Look at the picture below. Can you see little grey squares in the intersections of the white lines? Write a GraphicsProgram that create the optical illusion:
You may notice that the starter code for this project has the lines:
private static final int SIZE = 100;
private static final int GAP = 10;
This problem requires using a for loop inside a for loop. Remember to use a different iterator variable for the inner loop. For example if your outer loop is of the form
for(int i = 0; i < 100; i++)
If you have time, try creating this optical illusion! Note that all the squares are the same size and all lines are horizontal! Think about how to decompose your solution.
If you are stuck, try drawing each row with the first black square always starting at x = 0. Then try to figure out how to create the offset pattern.