Working with loops.
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.
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.
Write a second loop to draw the second row of circles that overlap in the opposite direction.
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.
Have your program color in the pattern with an interesting
design.
- Turn in the final version of your code.
- A screenshot of just your drawing.
- If you did the extra credit, give a short "painting
gallery blurb" explaining your inspiration.