The Java files used at the quiz review are available on the web at:
http://www.cag.lcs.mit.edu/~lfgs/cs101/q1rev/
javadoc-generated documentation is available at:
http://www.cag.lcs.mit.edu/~lfgs/cs101/q1rev/
Paper copies are also available in lab. However, there
is a small (but important) type in the paper copies:
In the Robot class's constructor, we forgot to initialize and
start this.spirit. (What happens if we don't do this?)
So, the correct code should be:
public Robot( Stepper s, Color c )
{
this.myStepper = s;
this.c = c;
this.spirit = new Thread( this );
this.spirit.start();
}
As far as I know, there are no other bugs.
OK. I hope these examples help you study for the quiz.
If there's anything that you don't understand, please feel free
to email 6.096-staff@mit.edu.
Good luck!
- Luis