Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Computer Graphics Exercises [7/9]

[Run the program]

Exercise:

Exercise 6 output image

Connect each horizontal pair of discs with a horizontal line. Each line should span from one disc center to the other disc center.

Hint 1

Since lines connect disc centers, the line function uses the same coordinates as the disc functions.

Solution

for #i=10..720 +=50
	{
	disc(i, i, 10);
	disc(960-i, i, 10);
	line(i, i, 960-i, i);
    sleepMs(100);
	}

Loading...