Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Simple Graphics [15/15]

This program draws a triangle consisting of spaced lines exhibiting a slight moire effect.
[Run the program]

Exercises:

1. What happens when you change the last argument (the number 650) of the line procedure call? Try out values 400, 200, 0, and 500.

2. What happens when you change the second argument of the line procedure call? Try out various values in the range from 0 to 700.

Simple Graphics - upside-down triangle task


3. Change the program so that the triangle of lines is displayed upside-down.

Solution

    line(450, 650, x, 100);

Loading...