CSC103 Homework 5 Solution 2012
--D. Thiebaut 17:02, 7 March 2012 (EST)
void setup() {
size( 500, 500 );
smooth();
}
void draw() {
background( 200 );
for ( int x=0; x < 500; x = x+20 ) {
fill( x/2, 255-x, 0 );
rect( 0, x, 500, 20 );
fill( 250, 200, 8 );
if ( mouseY < x ) {
ellipse( 20, x+10, 20, 20 );
}
else {
ellipse( 500-20, x+10, 20, 20 );
}
}
}