Graphic JavaScript

Back to index


Your browser does not support the HTML5 canvas tag. ASSIGNMENT:
The student will create an applet similar to the one shown to the left. However, instead of having twenty-five circles and squares, there will be only nine. The circles and squares will need to be resized so that they fill up the 300x300 pixel area of the canvas. The student may want to use a for loop or the student may prefer to simply type out nine individual calls to the rect method and nine individual calls to the arc method as well as the accompanying calls to stroke(), beginPath(), etc. Another approach which will be allowed is to draw lines instead of squares. (Recall that to draw a line requires a call to moveTo and lineTo in addition to the calls to beginPath and stroke.)