Answer:
Of course.
Blizzard
The paint() method can be modified to draw several dozen
snowflakes of random colors at random locations:
|
Embedded Java applet removed: modern browsers do not support Java applets. The surrounding source code is retained for historical study.
|
A counting loop controls how many flakes are drawn. The location and size of each flake is determined by:
x = rand.nextInt( width );
y = rand.nextInt( height );
size = rand.nextInt( 20 );
QUESTION 16:
How many different colors are there in this picture?