014 -- Flipping Square I: Simple State Machines (Due Monday 9/18)
This exercise tests your ability to maintain system state in some sort of variable, and also asks you to devise a way of testing the containment of a point (the cursor) within a special region (a reactive square).
In a 400x400 canvas, create a 100x100 pixel reactive square, such that each click in the square flips its color from white to black (if it is white), or from black to white (if it is black). Mouse clicks outside the square should have no effect! This example may be helpful to you.