Learn to Program with ZedLX

Free Online Programming Course for Beginners

Simple Graphics [8/15]

The line procedure draws a line. It can accept five arguments: line(x1, y1, x2, y2, color)

Arguments are sometimes also called parameters. The last parameter, color, can be omitted.

This program contains two calls of the disc procedure, and one call of the line procedure. A procedure call causes the execution of the procedure.

Exercises

1. Modify the second call of procedure disc to draw at coordinates (555, 444).

2. Modify the call of procedure line so that it connects the two discs.

Solution

    line(70, 90, 555, 444, /yellow);

Loading...