well, no one is going to do the assignment for you, but i think asking for help isn't a big deal. these forums exist to help us share knowledge.
so, with that being said, i'll talk generally about some ideas that might help you formulate a solution.
so, lets break this problem down.
variables you'll need:
speed (getting speed from the mouse might be a really easy way to put a value here, you can look that up here:
http://processing.org/reference/mouseX.html)
color (six different colors:
http://processing.org/reference/color_datatype.html)
a boolean (a true/false variable) to indicate whether your desired color was clicked on :
http://processing.org/reference/boolean.html
an integer to store how many times your boolean was indicated as true.
so, one way you might go about doing the assignment is tracking the speed of your mouse. have the box (
http://processing.org/reference/rect_.html) change colors (
http://processing.org/reference/fill_.html) based on the speed of your mouse. now, if you happen to click your mouse (
http://processing.org/reference/mousePressed_.html) while the color is your desired color (doing a simple if comparison:
http://processing.org/reference/if.html), then increment your counter by one.
so, hopefully that conceptually helps you break down the problem into smaller chunks that you can research and learn about on your own. The best way (in my opinion) to learn programming is to focus on one small part of the problem at a time.
So, first solve the problem: "how do i get a speed variable to change?"
then "how do i get colors to change based on speed?"
then move on to "how can i tell if a color matches the desired color when i click?"
and finally "how do i store the results?"
just treat them as four individual problems, and as you solve each one you'll find that you make your way towards the total solution.
If you were hoping for code, well, sorry. But if you were looking for a direction to start working in, then I hope this helps
-j
/*
thinking about learning how to think in order to more effectively learn
*/