Lesson goal: Learn to draw simple computer graphics

Previous: Clearing the screen | Home | Next: Drawing circles

After you can draw pixels, the next step will be to draw lines. The computer knows how to automatically draw a continuous line between any two (x,y) coordinates. Lines are drawn using the line function, which works like this:
line(x1,y1,x2,y2)
Move the mouse over a dotted box for more information.

Now you try. Plot a lines using line.

Type your code here:


See your results here: