JavaScript Graphics

Back to index

Your browser does not support the HTML5 canvas tag. ASSIGNMENT:
Study the project to the left. Notice that several methods that are called eight times each only appear once in the code. What happens is that these methods are called iteratively from within for-loops. You will need to use this technique to create a display which implements the following specifications:
  1. Create nine filled circles arranged in three rows of three.
  2. Connect the centers of all circles with horizontal and vertical lines. There will be no diagonal lines.
  3. Make the nine circles nine different colors, but only one line setting the color may appear in your code. (HINT: Store color values in an array.)
  4. The lines should not be drawn over the circles and may be any color which shows up clearly against the background color.