Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Simple Graphics [8/15]

The line procedure draws a line.

The line procedure can accept 5 arguments:
line(x1, y1, x2, y2, color)

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

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

Exercises

1. Modify the second call of procedure disc so that the disc is drawn at coordinates (555, 444).

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

Solution

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

Loading...