Objectivesnails

Working with loops.

Coloring books for adults

Coloring books designed for adults have become popular. Many of these contain repetitive geometric patterns that are probably produced by computer. Here is one such pattern that is the basis for this assignment.

Part 1 (10 points) First Row

You are going to write a program to create a larger version of this pattern of overlapping circles. The circles will be of diameter 100, and your final drawing will have 8 rows.

Create an 800 x 800 drawing panel. (If that is too large for your screen, you can scale things down to circles of diameter 50 and a 400 x 400 drawing panel. You still should have room for 8 rows.)

For part 1 make a loop to draw the first row. Note how the circles align with and some extend past the edges. Match that. Objects can be drawn at coordinates outside the drawing panel and will be automatically clipped to just show the part that intrudes into the panel.

Part 2 (10 points) Second Row

Write a second loop to draw the second row of circles that overlap in the opposite direction.

Part 3 (10 points) Another loop to draw 8 rows, plus a final border

Add a third loop to repeat your above two loops so that you get 8 rows. This is called loop nesting. In your case you will have two loops nested within a third. You will probably need to adjust your previous code slighly to work at multiple levels. Note: do not just make 8 loops! Good programmers try to avoid repetitious code. Think smarter not harder.

Finally, draw a border around your drawing.

Extra Creativity Credit (5 points) Color it in (with your program)

Have your program color in the pattern with an interesting design.

What to turn in
  1. Turn in the final version of your code.
  2. A screenshot of just your drawing.
  3. If you did the extra credit, give a short "painting gallery blurb" explaining your inspiration.