Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

The if Statement [11/16]

This program draws 150 discs. The discs in the middle of the screen are painted in red, and the discs on the sides are in blue.

Exercise:

Exercise if statement 10-1 output image

Modify this program such that only the discs in the top left quarter of the screen are painted in red, and other ones in blue.

Solution

	if x<480 and y<360
		: mycolor = /red;

Loading...